Hello,
I execute a curl request on Postman and that works fine
I tried to convert it and execute with gatling but i get 403 as response
I just copy/past the request send from gatling log and execute in Postman and it works !
in the log it is like this : client_id=${client_id}&code=${code}&code_verifier= …
byteArraysBody=
I have no idea what can be missing
If anyone can help or has already encoutered this issue
http(“test1”)
.post("/oauth2/default/v1/token/")
.header(“Content-Type”,“application/x-www-form-urlencoded; charset=utf-8”)
.body(ElFileBody(“request.txt”))
In the text file something like this
client_id=${client_id}&code=${code}&code_verifier=${code_verifier}&grant_type=authorization_code&redirect_uri=…
403 means forbidden.
You’re probably missing some Authorization header.
Thanks Stephan for taking time to respond
This is the original CURL request there is nothing specifique
When i applied the same in postman it works without specifique Authorization headers , hence my question
curl -v \
-X POST \
-H "Content-Type: application/x-www-form-urlencoded; charset=utf-8" \
-d "client_id={client_id}&code={CODE}&code_verifier={code_verifier}&grant_type=authorization_code&redirect_uri={value}&state={state}" \
"https://{URL}/oauth2/default/v1/token"
Thanks in advance
Try using formParam instead of setting the body
e.g.
Hi Stephane
Thanks for your help
I was due to some automaticly add cookies.
Using .exec(flushCookieJar) before the exec helped .