In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains the "what is the role of Content Type attributes", the content of the explanation is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "what is the role of Content Type attributes" bar!
Value type of Content-Type
Application/json: the message body is a serialized JSON string
Application/x-www-form-urlencoded: data is encoded as name / value pairs. This is the standard coding format.
Multipart/form-data: you need to use this format when you need to upload files in the form. Common media formats are used when uploading files
Text/plain: data is encoded in plain text (text/json/xml/html) and does not contain any controls or format characters.
The role of Content-Type
The difference between application/json and application/x-www-form-urlencoded
Application/json:
Function: tell the server that the subject content of the request is a string in json format, and the server will parse the json string
Benefits: front-end staff do not need to care about the complexity of the data structure, as long as the standard json format can be successfully submitted.
Application/x-www-form-urlencoded: is the default Ajax request method for Jquery
Function: in the process of sending the request, the data will be serialized and sent to the server in the form of key-value pairs? key1=value1&key2=value2
Benefit: all browsers support
Application/x-www-form-urlencoded: information data is encoded as name / value pairs, which is the standard and default encoding format
When action is get, the client converts the form data into a string append to url, using'?' Split.
When action is post, the browser encapsulates the form data into httpbody and sends it to server.
Thank you for your reading, these are the contents of "what is the role of Content Type attributes". After the study of this article, I believe you have a deeper understanding of what the role of Content Type attributes is, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.