cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
129
Views
4
Helpful
1
Replies

What is x-www-form-urlencoded?

Mitrixsen
Level 1
Level 1

Hello, everyone.

When sending API calls to SD-WAN vManage, you must first log in with username and password (specified as j_username and j_password) and send a POST request to the vManage under /j_security_check. This will generate a JSESSION ID as a cookie - which is then used to generate a token so we can make API Requests..

Mitrixsen_0-1750321991309.png

The documentation states that the POST request for the cookie/session ID must have the data/form set to x-www-form-urlencoded What does this mean? Postman has several options for us to use to specify the data, but the form mentioned above always has to be selected otherwise the request won’t work. What exactly is www-form-urlencoded?

Thank you.
David

1 Accepted Solution

Accepted Solutions

Hey @Mitrixsen  x-www-form-urlencoded means, the data in your post request body must be formatted as key-value pairs which must be separated by ampersands, so in sd-wan you have  j_username=yourusername&j_password=yourpassword. This is a data encoding format that converts form data into a url like string format where spaces become '+' signs, special characters are percent encoded (like %20 for space)

If you tried to send this say in json ({"j_username": "user", "j_password": "pass"}), the vManage authentication handler would not get this or parse it correctly, which would cause any login to fail even if you used the right correct creds.

This document will help too https://apidog.com/articles/x-www-form-url-encoded-requests/

Hope this helps.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

View solution in original post

1 Reply 1

Hey @Mitrixsen  x-www-form-urlencoded means, the data in your post request body must be formatted as key-value pairs which must be separated by ampersands, so in sd-wan you have  j_username=yourusername&j_password=yourpassword. This is a data encoding format that converts form data into a url like string format where spaces become '+' signs, special characters are percent encoded (like %20 for space)

If you tried to send this say in json ({"j_username": "user", "j_password": "pass"}), the vManage authentication handler would not get this or parse it correctly, which would cause any login to fail even if you used the right correct creds.

This document will help too https://apidog.com/articles/x-www-form-url-encoded-requests/

Hope this helps.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io