UNPKG

@d1g1tal/transportr

Version:

JavaScript wrapper for the Fetch API and more...

249 lines (248 loc) 8.98 kB
/** * Defining a constant object with all the HTTP request headers. */ declare const HttpRequestHeader: { /** * Content-Types that are acceptable for the response. See Content negotiation. Permanent. * * @example * <code>Accept: text/plain</code> */ readonly ACCEPT: "accept"; /** * Character sets that are acceptable. Permanent. * * @example * <code>Accept-Charset: utf-8</code> */ readonly ACCEPT_CHARSET: "accept-charset"; /** * List of acceptable encodings. See HTTP compression. Permanent. * * @example * <code>Accept-Encoding: gzip, deflate</code> */ readonly ACCEPT_ENCODING: "accept-encoding"; /** * List of acceptable human languages for response. See Content negotiation. Permanent. * * @example * <code>Accept-Language: en-US</code> */ readonly ACCEPT_LANGUAGE: "accept-language"; /** * Authentication credentials for HTTP authentication. Permanent. * * @example * <code>Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==</code> */ readonly AUTHORIZATION: "authorization"; /** * Used to specify directives that must be obeyed by all caching mechanisms along the request-response chain. * Permanent. * * @example * <code>Cache-Control: no-cache</code> */ readonly CACHE_CONTROL: "cache-control"; /** * Control options for the current connection and list of hop-by-hop request fields. Permanent. * * @example * <code>Connection: keep-alive</code> * <code>Connection: Upgrade</code> */ readonly CONNECTION: "connection"; /** * An HTTP cookie previously sent by the server with Set-Cookie (below). Permanent: standard. * * @example * <code>Cookie: $Version=1, Skin=new,</code> */ readonly COOKIE: "cookie"; /** * The length of the request body in octets (8-bit bytes). Permanent. * * @example * <code>Content-Length: 348</code> */ readonly CONTENT_LENGTH: "content-length"; /** * A Base64-encoded binary MD5 sum of the content of the request body. Obsolete. * * @example * <code>Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ==</code> */ readonly CONTENT_MD5: "content-md5"; /** * The MIME type of the body of the request (used with POST and PUT requests). Permanent. * <code>Content-Type: application/x-www-form-urlencoded</code> */ readonly CONTENT_TYPE: "content-type"; /** * The date and time that the message was sent (in "HTTP-date" format as defined by RFC 7231 Date/Time Formats). * Permanent. * * @example * <code>Date: Tue, 15 Nov 1994 08:12:31 GMT</code> */ readonly DATE: "date"; /** * The domain name of the server (for virtual hosting), and the TCP port number on which the server is listening. The * port number may be omitted if the port is the standard port for the service requested. Permanent. Mandatory since * HTTP/1.1. * * @example * <code>Host: en.wikipedia.org:80</code> * <code>Host: en.wikipedia.org</code> */ readonly HOST: "host"; /** * Only perform the action if the client supplied entity matches the same entity on the server. This is mainly for * methods like PUT to only update a resource if it has not been modified since the user last updated it. Permanent. * * @example * <code>If-Match: "737060cd8c284d8af7ad3082f209582d"</code> */ readonly IF_MATCH: "if-match"; /** * Allows a 304 Not Modified to be returned if content is unchanged. Permanent. * * @example * <code>If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT</code> */ readonly IF_MODIFIED_SINCE: "if-modified-since"; /** * Allows a 304 Not Modified to be returned if content is unchanged, see HTTP ETag. Permanent. * * @example * <code>If-None-Match: "737060cd8c284d8af7ad3082f209582d"</code> */ readonly IF_NONE_MATCH: "if-none-match"; /** * If the entity is unchanged, send me the part(s) that I am missing, otherwise, send me the entire new entity. * Permanent. * * @example * <code>If-Range: "737060cd8c284d8af7ad3082f209582d"</code> */ readonly IF_RANGE: "if-range"; /** * Only send the response if the entity has not been modified since a specific time. Permanent. * * @example * <code>If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT</code> */ readonly IF_UNMODIFIED_SINCE: "if-unmodified-since"; /** * Limit the number of times the message can be forwarded through proxies or gateways. Permanent. * * @example * <code>Max-Forwards: 10</code> */ readonly MAX_FORWARDS: "max-forwards"; /** * Initiates a request for cross-origin resource sharing (asks server for an 'Access-Control-Allow-Origin' response * field). Permanent: standard. * * @example * <code>Origin: http://www.example-social-network.com</code> */ readonly ORIGIN: "origin"; /** * Implementation-specific fields that may have various effects anywhere along the request-response chain. Permanent. * * @example * <code>Pragma: no-cache</code> */ readonly PRAGMA: "pragma"; /** * Authorization credentials for connecting to a proxy. Permanent. * * @example * <code>Proxy-Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==</code> */ readonly PROXY_AUTHORIZATION: "proxy-authorization"; /** * Request only part of an entity. Bytes are numbered from 0. See Byte serving. Permanent. * * @example * <code>Range: bytes=500-999</code> */ readonly RANGE: "range"; /** * This is the address of the previous web page from which a link to the currently requested page was followed. (The * word "referrer" has been misspelled in the RFC as well as in most implementations to the point that it has become * standard usage and is considered correct terminology). Permanent. * * @example * <code>Referer: http://en.wikipedia.org/wiki/Main_Page</code> */ readonly REFERER: "referer"; /** * The transfer encodings the user agent is willing to accept: the same values as for the response header field * Transfer-Encoding can be used, plus the "trailers" value (related to the "chunked" transfer method) to notify the * server it expects to receive additional fields in the trailer after the last, zero-sized, chunk. Permanent. * * @example * <code>TE: trailers, deflate</code> */ readonly TE: "te"; /** * The user agent string of the user agent. Permanent. * * @example * <code>User-Agent: Mozilla/5.0 (X11, Linux x86_64, rv:12.0) Gecko/20100101 Firefox/21.0</code> */ readonly USER_AGENT: "user-agent"; /** * Ask the server to upgrade to another protocol. Permanent. * * @example * <code>Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11</code> */ readonly UPGRADE: "upgrade"; /** * A general warning about possible problems with the entity body. Permanent. * * @example * <code>Warning: 199 Miscellaneous warning</code> */ readonly WARNING: "warning"; /** * mainly used to identify Ajax requests. Most JavaScript frameworks send this field with value of XMLHttpRequest. * * @example * <code>X-Requested-With: XMLHttpRequest</code> */ readonly X_REQUESTED_WITH: "x-requested-with"; /** * A de facto standard for identifying the originating IP address of a client connecting to a web server through an * HTTP proxy or load balancer. * * @example * <code>X-Forwarded-For: client1, proxy1, proxy2</code> * <code>X-Forwarded-For: 129.78.138.66, 129.78.64.103</code> */ readonly X_FORWARDED_FOR: "x-forwarded-for"; /** * A de facto standard for identifying the original host requested by the client in the Host HTTP request header, since * the host name and/or port of the reverse proxy (load balancer) may differ from the origin server handling the * request. * * @example * <code>X-Forwarded-Host: en.wikipedia.org:80</code> * <code>X-Forwarded-Host: en.wikipedia.org</code> */ readonly X_FORWARDED_HOST: "x-forwarded-host"; /** * A de facto standard for identifying the originating protocol of an HTTP request, since a reverse proxy (load * balancer) may communicate with a web server using HTTP even if the request to the reverse proxy is HTTPS. An * alternative form of the header (X-ProxyUser-Ip) is used by Google clients talking to Google servers. * * @example * <code>X-Forwarded-Proto: https</code> */ readonly X_FORWARDED_PROTO: "x-forwarded-proto"; }; export { HttpRequestHeader };