简体   繁体   中英

Forbidden response in post request-jMeter

I am trying hit localhost from jMeter with port 9090 and passing two user name and password parameters. When I run the test plan I'm getting the Forbidden response from jMeter.

My test plan is as follows,

在此处输入图片说明

And If run the above test plan the result is like this,

在此处输入图片说明

How to resolve this? Any suggestions please!!

It looks like Basic Authentication challenge. Add a HTTP Authorization Manager to your test plan and put authentication details in there.

You are using the incorrect authentication method for the server.

The way you have programmed jmeter will send a request to the server like:

http://localhost:9090/node?name=admin&pass=admin

However, your server is expecting a request like:

http://admin:admin@localhost:9090/

The former is an application authentication method, and the latter is server basic authentication method.

To provide the server with the correct request for Basic Authentication you can use the HTTP Authorization Manager, using your username and password. This will manage the entire security session for you during your tests. It will keep you logged on as you send further requests.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM