I have to request a json
for a api
, however I have to retrieve data from a form to complement this json
, the problem is that by saving the data to a variable I can not put it Correct way within that json
, I tried to concatenate it in different ways and the value is never passed correctly.
$str = '{
"clienteLogin":
{
"Token":"29b3bcbde41b48058bf410da09910849",
"Operador":"",
"IdUnidadeNegocio":8,
"PalavraCaptcha":"",
"nome": "$nome", //variavel 1
"cadastro":"on",
"Email": "$email" // variavel 2
},
"mesclarCarrinho":true,
"Token":"29b3bcbde41b48058bf410da09910849",
"IdUnidadeNegocio":8,
"Operador":""
}';