HTTPAuthorizationManager authorization url is not appending to post api in jmeter whereas for get it is appending

23 Views Asked by At

I am new to JMeter, Initially I implemented GET Services for load testing which worked fine, So I started adding POST apis, which are failing with 401 Unauthorized.

I checked request body for both get and post api responses in jmeter, I can see authorization URL which was given in HTTPAuthorizationManager is appending before actual URL in GET calls, which is giving 200 OK. Where as for POST apis authorization URL is not appending which resulting 401 unauthorized error.

Can anyone help on this.

1

There are 1 best solutions below

0
Dmitri T On

Given Base URL of the HTTP Authorization Manager matches the current URL of the HTTP Request sampler - it will add the appropriate Authorization header to the request.

It doesn't matter whether the request method is GET or POST - the header will be added. If the header is not handled for POST request on the system under test side - it's either an issue or it functions as designed, we cannot tell you this for sure.

I can only demonstrate you that JMeter adds the Authorization headers for example.com base URL and doesn't for blazedemo.com URL:

enter image description here

More information: How to Use HTTP Basic Authentication in JMeter