Reputation: 174
I have a valid HTTP GET request which is returning a 200 OK on both curl and postman, however, when run in Jmeter it keeps returning a 400 bad Request with a response body as follows
<HTML><HEAD>
<TITLE>Invalid URL</TITLE>
</HEAD><BODY>
<H1>Invalid URL</H1>
The requested URL "[no URL]", is invalid.<p>
Reference #9.2ea93d42.1511385794.51815e
</BODY></HTML>
Not sure what am i doing wrong?
Upvotes: 1
Views: 5384
Reputation: 1
Just put HTTP Header Manager above your request and add this:
Content-Type : application/x-www-form-urlencoded
Upvotes: 0
Reputation: 31
I faced the same issue and i added the baseURL value to the 'Host' parameter in Header section.
eg: if your site's baseURL is "http://test.com".
In Header manager section -> add Host: test.com
Upvotes: 2
Reputation: 174
Alright, so I figured it out. For some odd reason when I put the whole url string in the "path" field, the test works as expected i.e. returns a 200. Don't ask me why that is, perhaps something for Apache folks to answer.
Upvotes: 0
Reputation: 34526
Ensure you add a Header Manager as child of your HTTP Request and add headers:
Content-Type : application/json
Upvotes: 1