How can I send "x-auth-token" param to server with headers in YII.
I have this code
$data = array('customerId' => $userId);
$getdata = http_build_query(
$data
);
$options = array('http' =>
array(
'method' => 'GET',
'header' => "Content-type: application/x-www-form-urlencoded\r\n".
" Authorization: x-auth-token ".$token." \r\n",
'content' => $getdata
)
);
$context = stream_context_create($options);
$result = file_get_contents('url?'.$getdata, false, $context);
in Android we are sending data like this request.addHeader("x-auth-token", token);
I have no access to server, I am just sending requests and getting data. But after login I need to send login token to get data, but it is returns me 403.
So I think it is not sending the token. How can I do that?