Protocol for Sending Headers

Hi, I’m working on an app based on my research here. Some of the workflow here is behind the scenes and I need to understand that flow.

How do the headers get sent out? Do I create one larger message with the headers and request as one big block of text? Or, do the headers get send as separate blocks?

Works great in Postman but I’m working outside of Postman on this request.

Thanks,
dj

Hey @djquecke :wave: Welcome to the community!

I’m guessing you are trying to understand how the HTTP protocol works? For that I would suggest checking out this good resource to get you started: An overview of HTTP - HTTP | MDN

In short, HTTP is a text-based protocol, and every HTTP request will contain headers as part of the request, along with any data-payload where applicable.
For HTTP methods that can accept body-payload (POST etc) headers and the payload are separated by a single blank line (more specifically \r\n). So to answer your question, headers + data are sent together.

Example POST request:

POST /post HTTP/1.1
Host: postman-echo.com
Content-Type: application/json
Content-Length: 39

{
"id": "xyz",
"record": 1
}

In Postman you actually check the exact HTTP request being sent via the Postman Console’s:

If you want to get a deeper understanding of HTTP protocol, have a look at the HTTP RFC.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.