Get XSRF token and set it to a cookie variable in postman for using later.
Last active
April 29, 2021 19:50
-
-
Save amrography/baf6dca34128f02570d8515bfdf7a13a to your computer and use it in GitHub Desktop.
Set cookie in postman pre-request for Laravel Nova #api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pm.sendRequest({ | |
url: `http://localhost:8000/nova/login`, | |
method: "GET", | |
}, (error, response, { cookies }) => { | |
if (!error) { | |
pm.environment.set('xsrf-cookie', cookies.get('XSRF-TOKEN')) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment