Handling API requests with CSRF token #187
Unanswered
samuelvinay91
asked this question in
Q&A
Replies: 1 comment 8 replies
-
Can you try using withForm in the place of await spec()
.post("/signin")
.withHeaders('X-CSRF-Token', res.headers["x-csrf-token"])
.withForm({
email: process.env.MFA_USERNAME,
password: process.env.MFA_PASSWORD,
_csrf: res.headers["x-csrf-token"],
}); |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi ,
@ASaiAnudeep - Thank you so much for your reply.
This below code using axios was working fine for all subsequent calls internally I am using agent
same I am trying to do in pactum
Correct me please if I am missing or doing anything wrong
Beta Was this translation helpful? Give feedback.
All reactions