What’s the difference between “Request Payload” vs “Form Data” as seen in Chrome dev tools Network tab

The Request Payload – or to be more precise: payload body of a HTTP Request is the data normally send by a POST or PUT Request. It’s the part after the headers and the CRLF of a HTTP Request. A request with Content-Type: application/json may look like this: If you submit this per AJAX the browser simply shows you what it is … Read more

What are all the possible values for HTTP “Content-Type” header?

You can find every content type here: http://www.iana.org/assignments/media-types/media-types.xhtml The most common type are: Type applicationapplication/java-archive application/EDI-X12 application/EDIFACT application/javascript application/octet-stream application/ogg application/pdf application/xhtml+xml application/x-shockwave-flash application/json application/ld+json application/xml application/zip application/x-www-form-urlencoded Type audioaudio/mpeg audio/x-ms-wma audio/vnd.rn-realaudio audio/x-wav Type imageimage/gif image/jpeg image/png image/tiff image/vnd.microsoft.icon image/x-icon image/vnd.djvu image/svg+xml Type multipartmultipart/mixed multipart/alternative multipart/related (using by MHTML (HTML mail).) multipart/form-data Type texttext/css text/csv text/html … Read more

Why is it said that “HTTP is a stateless protocol”?

Even though multiple requests can be sent over the same HTTP connection, the server does not attach any special meaning to their arriving over the same socket. That is solely a performance thing, intended to minimize the time/bandwidth that’d otherwise be spent reestablishing a connection for each request. As far as HTTP is concerned, they … Read more

HTTP GET request in JavaScript?

Browsers (and Dashcode) provide an XMLHttpRequest object which can be used to make HTTP requests from JavaScript: However, synchronous requests are discouraged and will generate a warning along the lines of: Note: Starting with Gecko 30.0 (Firefox 30.0 / Thunderbird 30.0 / SeaMonkey 2.27), synchronous requests on the main thread have been deprecated due to the negative … Read more