Getting Unauthorized error in Send Request Test Script

I have a authorization token(Bearer Token) Used in Sending API Requests there the request is getting sent and the response also been received but the same authorization token is giving me Unauthorized Response when used in Test Script. Please Help on this

    url: '',
    method: 'GET',
    headers: {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer my_working_token', 
    body: {
        mode: 'none',
}, function(err, response) {
    if (err) {
    pm.test("Response status code is 201", function () {;

Tell me if Iā€™m missing something here or any setting to be enabled.

Also, I have tested the Authorization token externally in python there also the request is being sent successfully. Facing issue only in Test Script and Pre-request script in Postman.

Hey @roopesh07 :wave:

The correct key name for the Headers is header - that might be the issue.

Hey Danny :wave: :smiley:,
It worked!! Thank you so much for the solution. I did not even noticed it. I have been using the autogenerated script from Postbot.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.