Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What is the format of this variable?

i’m trying to do a POST request with an API taking a specific format of variable.
But I can’t figure out what the format of this is?
enter image description here

The full request payload is

csrfmiddlewaretoken=XXXXXXXXX&username=Test&first_name=Test1&last_name=Test2&email=test%40gmail.com&password1=Testtest24&password2=Testtest24

My goal is to be able to make a variable with the same format in angular.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

This is the application/x-www-form-urlencoded format, i.e. the same format browsers use to encode data of plain HTML forms sent to a server.

Data in this format can usually be used either by appending it to a GET request as e.g. https://example.com?foo=bar&alice=bob or within the body of a POST request with the correct Content-Type header.

When sending a request in Angular, you generally do not have to deal with this encoding as Angular itself will take care of properly encoding it before sending the data to the server.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading