POST encoding

2

In Web requests when posting data on a server a string from the template below (using the parameters):

string hello = "hello";
string token = "teste==";

It is transformed into post data like the ones shown below:

string post = "msg=hello&token=teste%3D%3D";

What type of encoding was used here, I know that the JSON serializer class can be used to serialize parameters, but which encoding was used above?

    
asked by anonymous 12.08.2016 / 16:12

1 answer

1

This is called percent encoding . This is used to allow escape of characters that are part of the content but are confused with special characters used in specific URL URL / URI . All basic text characters are called unreserved characters . The same holds true for encoding binary data since they flee from unreserved characters and need to escape the representation of all possible 256 bytes.

The RFC 3986 describes this.

Character encoding depends on what has been established, it is very common on the web to be UTF-8, but it is not required.

    
12.08.2016 / 16:23