1

I use the postman request the bellow URL, it will get error:

http://localhost:8000/api/users/register/

the CSRF cookie error:

CSRF Failed: CSRF cookie not set.

the settings of my request in postman:

enter image description here

but if I write the request in PHP code then execute it there will not have this issue:

$params = array(
    "whmcs_tblclients_id" => 1232,
    "email" => "test22@qq.com",
    "username" => "asdas_asda",
    "phone" => "15883332126",
    "password" => "123456"
);

$request = Requests::post('http://localhost:8000/api/users/register/', array(), $params);
sof-03
  • 2,255
  • 4
  • 15
  • 33

1 Answers1

1

For send/recieve cookies you should enable Interceptor in Postman. Refer,

http://blog.getpostman.com/2014/11/28/using-the-interceptor-to-read-and-write-cookies/

Refer below to know how to enable interceptor,

How to use Postman Interceptor

Additional to this, Postman Chrome app has been deprecated in the favor of native apps. So it is better to go for native app (in place of Chrome apps) which has direct support for intercepting cookies as mentioned in my answer. Refer,

http://blog.getpostman.com/2017/03/14/going-native/

Pallav Kabra
  • 418
  • 3
  • 7