Forum Discussion

obaid_shirwani's avatar
obaid_shirwani
Contributor
9 years ago
Solved

Special characters in Request body get converted to URL format.

I recorded a very simple test case.

 

1. Access a URL.

2. Provide credentials (User ID and Password)

3. Clicked the 'Sign in' button.

4. Logged out.

.

When verifying the scenario, I am getting an error message (200 (expected=302)). The actual issue is that the special charactes in my page's feilds are getting converted to special characters. Like for example, the 'User Name' field gets converted to 'Login%24UserName' from 'Login$UserName'.

 

Same goes for the data provided by the user. For example, the original password is 'P@ssword1'. This gets converted as 'P%40ssword1'.

 

The verification gets failed. How to get rid of this?

  • Hello obaid_shirwani,

     

    What is the content-type header field value for that request? I suppose, it is "application/x-www-form-urlencoded". If this is the case, then this behavior is correct and conforms to the HTTP standard - for that content type, the body must be url-encoded. The server must url-decode all the values to handle them.

     

    I think the verification failed for some other reason. We could help you better if you packed the entire LC project with the latest verification results and sent it to us in a support case:

    https://support.smartbear.com/message/?prod=LoadComplete

     

    Thanks!

1 Reply

  • Hello obaid_shirwani,

     

    What is the content-type header field value for that request? I suppose, it is "application/x-www-form-urlencoded". If this is the case, then this behavior is correct and conforms to the HTTP standard - for that content type, the body must be url-encoded. The server must url-decode all the values to handle them.

     

    I think the verification failed for some other reason. We could help you better if you packed the entire LC project with the latest verification results and sent it to us in a support case:

    https://support.smartbear.com/message/?prod=LoadComplete

     

    Thanks!