Skip to main content

I am calling this API by curl

$url = '/api/auth/login'; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{"fbUserID": "$fbID", "fbAccessToken": "$Token"}",

$url = '/api/auth/login';
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => "{\"fbUserID\": \"$fbID\", \"fbAccessToken\": \"$Token\"}",
    CURLOPT_HTTPHEADER => array(
        "accept: application/json",
        "cache-control: no-cache",
        "content-type: application/json"
    ),
)); 

$response = curl_exec($curl);
$jsonresult = json_decode($response);
$err = curl_error($curl);

My question is how i can I get the cookie value in response header  , iI am testing call in POSTMAN apiPOSTMAN API so iI am getting cookie value.

canCan you please help?

I am calling this API by curl

$url = '/api/auth/login'; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{"fbUserID": "$fbID", "fbAccessToken": "$Token"}",

CURLOPT_HTTPHEADER => array(
"accept: application/json",
"cache-control: no-cache",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$jsonresult = json_decode($response);
$err = curl_error($curl);

My question is how i can get cookie value in response header  , i am testing call in POSTMAN api so i am getting cookie value

can you please help

I am calling this API by curl:

$url = '/api/auth/login';
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => "{\"fbUserID\": \"$fbID\", \"fbAccessToken\": \"$Token\"}",
    CURLOPT_HTTPHEADER => array(
        "accept: application/json",
        "cache-control: no-cache",
        "content-type: application/json"
    ),
)); 

$response = curl_exec($curl);
$jsonresult = json_decode($response);
$err = curl_error($curl);

My question is how can I get the cookie value in response header, I am testing call in POSTMAN API so I am getting cookie value.

Can you please help?

Source Link

how to get cookie value from curl response in php

I am calling this API by curl

$url = '/api/auth/login'; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{"fbUserID": "$fbID", "fbAccessToken": "$Token"}",

CURLOPT_HTTPHEADER => array(
"accept: application/json",
"cache-control: no-cache",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$jsonresult = json_decode($response);
$err = curl_error($curl);

My question is how i can get cookie value in response header , i am testing call in POSTMAN api so i am getting cookie value

can you please help