Are HTTP headers case-sensitive?

Header names are not case sensitive. From RFC 2616 – “Hypertext Transfer Protocol — HTTP/1.1”, Section 4.2, “Message Headers”: Each header field consists of a name followed by a colon (“:”) and the field value. Field names are case-insensitive. The updating RFC 7230 does not list any changes from RFC 2616 at this part.

How does HTTP file upload work?

Let’s take a look at what happens when you select a file and submit your form (I’ve truncated the headers for brevity): POST /upload?upload_progress_id=12344 HTTP/1.1 Host: localhost:3000 Content-Length: 1325 Origin: http://localhost:3000 … other headers … Content-Type: multipart/form-data; boundary=—-WebKitFormBoundaryePkpFF7tjBAqx29L ——WebKitFormBoundaryePkpFF7tjBAqx29L Content-Disposition: form-data; name=”MAX_FILE_SIZE” 100000 ——WebKitFormBoundaryePkpFF7tjBAqx29L Content-Disposition: form-data; name=”uploadedfile”; filename=”hello.o” Content-Type: application/x-object … contents of file goes … Read more

Why is an OPTIONS request sent and can I disable it?

edit 2018-09-13: added some precisions about this pre-flight request and how to avoid it at the end of this reponse. OPTIONS requests are what we call pre-flight requests in Cross-origin resource sharing (CORS). They are necessary when you’re making requests across different origins in specific situations. This pre-flight request is made by some browsers as … Read more

Share cookie between subdomain and domain

If you set a cookie like this: Set-Cookie: name=value then the cookie will only apply to the request domain, and will only be sent for requests to the exact same domain, not any other subdomains. (See What is a host only cookie?) Two different domains (e.g. mydomain.com and subdomain.mydomain.com, or sub1.mydomain.com and sub2.mydomain.com) can only … Read more

application/x-www-form-urlencoded or multipart/form-data?

TL;DR Summary; if you have binary (non-alphanumeric) data (or a significantly sized payload) to transmit, use multipart/form-data. Otherwise, use application/x-www-form-urlencoded. The MIME types you mention are the two Content-Type headers for HTTP POST requests that user-agents (browsers) must support. The purpose of both of those types of requests is to send a list of name/value … Read more