Search code examples
restpostmaninsomnia

Different Responses from Insomnia and Postman for a WebRequest


I am using Postman Tool and Insomnia(Hurl.eu) Tool to make a Particular webRequest. I get the Response 200 from Insomnia but i am getting 403 Forbidden error from Postman.Here are the Preview messages from both

Postman:

POST /ccadmin/v1/login HTTP/1.1
Host: ccadmin-test-XXXX.oracleoutsourcing.com:443
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.NlCxWPgJAizSO60YeIBQRjgrYlgUhywr8vmnIca69A=ehkZS1iMzUyLWZkNmE1ODM1ZDM3NSIsImlzcyI6ImFwcGxpY2F0aW9uQXV0aCIsImlyJleHAiOjE1MDU4MzQ5NjIsInN1YiI6ImRiZTYwMGFkLWQwNjYtNDhdCI6MTQ3NDI5ODk2Mn0=.
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials




 Insomnia(Hurl):
    POST /ccadmin/v1/login HTTP/1.1
    Host: ccadmin-test-XXXX.oracleoutsourcing.com:443
    Accept: */*
    Content-Type: application/x-www-form-urlencoded
    Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.NlCxWPgJAizSO60YeIBQRjgrYlgUhywr8vmnIca69A=ehkZS1iMzUyLWZkNmE1ODM1ZDM3NSIsImlzcyI6ImFwcGxpY2F0aW9uQXV0aCIsImlyJleHAiOjE1MDU4MzQ5NjIsInN1YiI6ImRiZTYwMGFkLWQwNjYtNDhdCI6MTQ3NDI5ODk2Mn0=.
    Content-Length: 29

Both request looks similar ,but i am getting 2 different responses. I also disabled Postman Settings->

        i)Send Postman Token Header
        ii)Send no-Cache Header

enter image description here enter image description here


Solution

  • I hope this will help you.

    I have found that sometimes Postman behaves a bit weird when you are using Bearer Authorization, this since they made an update to the app and added the "Authorization" tab.
    This has happened to me more than ones, specially on pre existing collection.

    Let's give it a shot.

    1. Delete the Authentication key on your header, I can see you wrote that one manually. And lets Postman handle that.
    2. Open the Authorization tab, select the Bearer token type from the dropdown, add your token on the window in the left side.
    3. Click on Preview Request.
    4. Now you should be able to see the token on the headers "greyed out"
    5. Open the console, this will help you checking the request and maybe you will find an adicional error.
    6. On the console you can check the raw request and response, it helps.

    Also you should try making a request from your machine using CURL ‘yes you can usit on windows and mac’, this way you can discard that you have a closed port.

    It might help

    Good luck