Post request should create a data with provided extracted Bearer token and payload data
401 Unauthorized Response

In first function I am extracting the Bearer token and storing it in var token and passing the var onto second function that will create a data.
K6 response Log:


Please let me know what am I doing wrong. I was able to send the same post request using JMeter, Postman and Rest Assured....I been trying to get this done and add this script as my Load Test Stage into my GitLab CI Pipelines. But I am struck :(
Thank you in advance!
The parameters used in the post method are in the wrong order, the correct order would be:

let res = http.post(`${API_SERVER}/api/donors`, {
...body
}, {
headers
});
It is working now :) Thank you so much!
Most helpful comment
The parameters used in the post method are in the wrong order, the correct order would be: