I have this
{
"session":"59a28f4741b0800302147c4e8db00e5e",
"id":"765611988531745",
"rememberLogin":"76561198852231745||67b583c48e95a76fbcf7da254714e206"
}
how can I set this cookie to curl
headers when i send the POST
request?
I have this
{
"session":"59a28f4741b0800302147c4e8db00e5e",
"id":"765611988531745",
"rememberLogin":"76561198852231745||67b583c48e95a76fbcf7da254714e206"
}
how can I set this cookie to curl
headers when i send the POST
request?
You can convert with a simple function Curl cookie is something like a=b; c=d; So you need to convert your json to that.
function jsontocookie($json) {
$ret = "";
foreach(json_decode($json, true) as $key => $value){
$ret .= $key."=".$value."; ";
}
return $ret;
}
And send with CURLOPT_COOKIE
curl_setopt($ch, CURLOPT_COOKIE, jsontocookie($json));