HTTP content-type presentation

HTTP content-type

Content-Type (content type), generally refers to the Content-Type web pages exist for defining network file encoding type page, the browser will decide what form, what code reading this document, which is often seen Some of the results to the PHP page is clicked to download a file or a picture reasons.

Content-Type header tells the client to return the actual content type of the content.

Syntax:

Content-Type: text/html; charset=utf-8 Content-Type: multipart/form-data; boundary=something

Example:

Common media format types are as follows:

  • text / html: HTML format
  • text / plain: plain text
  • text / xml: XML format
  • image / gif: gif image formats
  • image / jpeg: jpg image format
  • image / png: png image format

Beginning with the application media type format:

  • application / xhtml + xml: XHTML format
  • application / xml: XML data format
  • application / atom + xml: Atom XML format polymerization
  • application / json: JSON format data
  • application / pdf: pdf format
  • application / msword: Word Document Format
  • application / octet-stream: the stream of binary data (such as the common file download)
  • application / x-www-form-urlencoded: <encType = "" form> the default encType, form form data sent is encoded as a key / value to format (data format default form submission) server

Another common media format is used when uploading documents:

  • multipart / form-data: file upload when required in form, it is necessary to use the format

Guess you like

Origin www.cnblogs.com/adspark/p/11753564.html