How much does an HTTP request spend?

Client

Sends a post without Body to any API

post('api.dominio.com')

Server

Returns only status code 204

return res.status(204)

Assuming that the above situation happens, the client makes a request without sending anything (practically a GET), and the server knowing that when that endpoit is requested, it must do something and in the end only respond 204, without returning anything else. In this request, the user spent dice?

I don't know if I'm being clear, but my doubt is more about the HTTP protocol, what is the minimum cost of it? does a Status Code consume data?

 5
Author: LINQ, 2019-05-13

1 answers

Yes the user has spent data, you can simulate this behavior by doing your own experiment as shown below:

For this I used the Postman and the Webhook.site :

By performing a POST to the generated Webhook URL, you can track your request by arriving at the site and returning the result to The Postman:

insert the description of the image here

You can see in the image that even without passing any body in the request, I sent approximately 307 bytes in headers for the Webhook.site, and in his answer he returned me approximately 380 bytes also in headers , with no content in the body.

Below you can see all the information sent and received in the headers of this request:

insert the description of the image here

Even without body, there is a variation in the headers. It all depends on the amount of information passed and returned, each server / application returns an X amount of data. The best form would in fact measure performing a request to the API.

 6
Author: nullptr, 2019-05-14 00:19:19