Skip to content

Latest commit

 

History

History
14 lines (13 loc) · 1.32 KB

headers.md

File metadata and controls

14 lines (13 loc) · 1.32 KB

Header Parsing

This library provides several useful methods for dealing with HTTP Headers:

  • parseHeaders - Parses a string into a list of named headers, useful for processing headers from XMLHttpRequest XMLHttpRequest.getAllResponseHeaders() or from parts of a multipart HTTP message.
  • parseContentType - Takes the value of the Content-Type header and returns the content in a usable format.
  • serializeContentType - Write an object representing a Content-Type to the correct format for a HTTP header.
  • parseContentDisposition - Takes the value of the Content-Type header and returns the content in a usable format.
  • serializeContentDisposition - Write an object representing a Content-Type to the correct format for a HTTP header.
  • isTextMediaType and isMultipartMediaType - For detecting if response mediatype is text or multipart respectively.

Reading

The implementation of these methods is based on the following RFCs: