is application/x-www-form-urlencoded default for html form?

前端 未结 3 839
挽巷
挽巷 2020-12-14 06:44

I found out that HTML form supports only two enctype types. They are application/x-www-form-urlencoded and multipart/form-data. I understand that I

相关标签:
3条回答
  • 2020-12-14 07:05

    Yes, it is. Here's a cite from the W3 HTML forms specification:

    The default value for this attribute is "application/x-www-form-urlencoded". The value "multipart/form-data" should be used in combination with the INPUT element, type="file".

    The webbrowser will take care about URL encoding automatically.

    0 讨论(0)
  • 2020-12-14 07:14

    Yes, the default enctype is application/x-www-form-urlencoded.

    0 讨论(0)
  • 2020-12-14 07:27

    application/x-www-form-urlencoded

    This is the default content type. Forms submitted with this content type must be encoded as follows:

    1) Control names and values are escaped. Space characters are replaced by '+', and then reserved characters are escaped as described in [RFC1738], section 2.2: Non-alphanumeric characters are replaced by '%HH', a percent sign and two hexadecimal digits representing the ASCII code of the character. Line breaks are represented as "CR LF" pairs (i.e., `%0D%0A').

    2) The control names/values are listed in the order they appear in the document. The name is separated from the value by '=' and name/value pairs are separated from each other by `&'.

    Check out this link for more on form content types, or here for more information about file uploads and such.

    0 讨论(0)
提交回复
热议问题