I try to test simple HTTP request with below setting. Simple HTTP Request

The response I get is:

Response code: Non HTTP response code: java.net.URISyntaxException Response message: Non HTTP response message: Illegal character in user info at index 7: http://[UserName:$$MyPass@@@www.URL.com]:8080/

I know the error reason is []. As we can see in Server Name or IP is explicitly not added.

But my question is What is the reason Browser add extra [] in my URL

  1. Don't put anything but server DNS hostname or IP address into the "Server Name or IP" input field.
  2. If you look into Reserved Characters section of URL specification you will see the list of characters which cannot be present in the URL:

    reserved = gen-delims / sub-delims

    gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"

    sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="

    if your URL contains any of the above characters it needs to be escaped via __urlencode() function

  3. Passing credentials in URL is not secure, I would recommend using HTTP Authorization Manager instead, check out How to Use HTTP Basic Authentication in JMeter for details.

  4. If you are uncertain regarding how to simulate this or that browser call in JMeter - just record it using HTTP(S) Test Script Recorder

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.