Hypertext Transport Protocol (HTTP) is the de facto protocol for sending data over the Internet. Today in addition to transporting hypertext documents, it is used to transport images, stylesheets, JavaScript, fonts - nearly everything in a web page. Rarely do developers pause to question why this is. Lately, I've been thinking a lot about HTTP and its relation to APIs and web apps. This document contains my thoughts on the usefulness of HTTP requests as envelopes for sending data.
HTTP requests consist of at least 7 pieces: the path, the query string, the method, the status, the headers, the body, and cookies. (Technically cookies are a subcategory of headers but they have additional behaviors that make them worth examining separately.) This article examines each of them from the perspective of their utility for carrying arbitrary data. Note: This article only looks at HTTP/1.
REST APIs often make use of HTTP methods and respo