JAVA HttpClient sending message method

When using HttpClient to request data, there are two ways to encapsulate request parameters: UrlEncodedFormEntity() and StringEntity() .

 

UrlEncodedFormEntity() is to parse the request parameters into the form of key=value&key=value.

For example: using UrlEncodedFormEntity() to send the request format is: {"age":"14","name":"lili","userId":1}, then the request parameters received by the server are: age=14&name=lili&userId =1

 

The data form of StringEntity() is relatively free, what format is sent, and what format is received by the server.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326269344&siteId=291194637