JIYIK CN >

Current Location:Home > Learning > NETWORK >

About application/x-www-form-urlencoded

Author:JIYIK Last Updated:2025/03/18 Views:

As a data format of form, application/x-www-form-urlencoded has its own characteristics

 

<form action= "handle.php" method= "post" >
   <input type= "text" name= " uname"   class= " uname" /><br />
   <input type= "text" name= "email" class= " email " /><br />
   <textarea rows= "5" cols= "5" name= "txt" ></textarea><br />
   <input type= "submit" name= "submit" value= " submit " />
</form>

If the enctype value is not specified, the default value is application/x-www-form-urlencoded. Of course, this data format cannot support file uploads. If we need to upload files at the same time, we can manually specify enctype="multipart/form-data".

Jiyi Blog - About application/x-www-form-urlencoded Figure 1

Figure 2

Jiyi Blog - About application/x-www-form-urlencoded Figure 2

From Figure 2, we can verify its replacement rule

When using the GET method for request, the form data is encoded as application/x-www-form-urlencoded and appended to the request address, separated by '?'.

Jiyi Blog - About application/x-www-form-urlencoded Figure 3

Let's briefly talk about the third value of enctype, text/plain. This encoding method is similar to application/x-www-form-urlencoded, but text/plain only replaces line breaks and spaces, and does not encode special characters. The Chinese characters in the above example will not be encoded.

Jiyi Blog - About application/x-www-form-urlencoded Figure 4

Furthermore, if the request is made in POST mode, the name and value in the message body will not be reorganized into the form of name=value&name=value.

The above is a brief introduction to the application/x-www-form-urlencoded encoding of the form. You are welcome to leave a message below for discussion and common progress.

For reprinting, please send an email to 1244347461@qq.com for approval. After obtaining the author's consent, kindly include the source as a link.

Article URL:

Related Articles

What multipart/form-data does in post Upload upload files

Publish Date:2025/03/18 Views:63 Category:NETWORK

Everyone has used the attribute enctype="multipart/form-data" when uploading files using a form. What is the role of multipart/form-data? Let's talk about this topic. First, let's look at a case Look at the first code   form action= "handl

My understanding of webservice is this

Publish Date:2025/03/18 Views:147 Category:NETWORK

Recently, I encountered such a project at work (temporarily named Project A). Project A itself was developed in PHP, but its data came from another project developed in Java (temporarily named Project B). Project A could not operate the dat

WSDL looks like this

Publish Date:2025/03/18 Views:190 Category:NETWORK

When I first started learning Webservice, I found that there were quite a lot of knowledge points involved, and each point could be a school of its own. Especially when I saw WSDL, I looked up information for a long time, but I was still a

Which technology do you choose to implement the web chat room?

Publish Date:2025/03/18 Views:61 Category:NETWORK

With the rise of HTML5 Websockets, web chat applications are becoming more and more popular. Recently, I am working on a mobile web application, the core function of which is to implement web chat on the mobile phone. Of course, the functio

Implementing a group chat room using socket.io

Publish Date:2025/03/18 Views:65 Category:NETWORK

This article will share with you an example of using socket.io to realize the function of group chat. If you want to use socket.io, you must use nodejs to implement the server, so we need to install socket.io in nodejs Install socket.io How

Getting started with FastCGI

Publish Date:2025/03/18 Views:164 Category:NETWORK

In "First Contact with CGI", we mentioned the operating mechanisms of CGI and Server APIs, as well as their respective advantages and disadvantages. In this chapter, we will learn about FastCGI, which combines the advantages of CGI and Serv

Ajax cross-domain cookie related settings

Publish Date:2025/03/18 Views:87 Category:NETWORK

In web programming, we often encounter cross-domain issues. By default, browsers do not allow cross-domain access. Therefore, there is a concept here: CORS (Cross-Origin Resource Sharing). Before the HTML5 standard came out, CORS was not al

Scan to Read All Tech Tutorials

Social Media
  • https://www.github.com/onmpw
  • qq:1244347461

Recommended

Tags

Scan the Code
Easier Access Tutorial