Laravel X-CSRF-Token mismatch with POSTMAN

前端 未结 4 1146
春和景丽
春和景丽 2021-01-04 02:36

I try to talk to my REST API built with Laravel. But the call with POSTMAN is rejected due to a token mismatch. I guess I need to include the CSRF token in the header. But d

4条回答
  •  盖世英雄少女心
    2021-01-04 03:33

    Use Postman
    Make a GET request to any page that has

    Copy the value from the response.

    Add a header field to your POST request:

    "X-CSRF-TOKEN: "copied_token_in_previous_get_response"
    

提交回复
热议问题