News for hackers. Stuff that matters.
Re:—-libcurl by incorrecthorse on Monday January 29, 2024 @10:29AM (#39177347)
HTTP requests don't need to have any specific headers, and, if anything, curl will only add ones for you.
Re:—-libcurl by ricardo81 on Monday January 29, 2024 @11:48AM (#39178541)
But specific HTTP requests might. Like cookies, an accept header, or anything.
Re:—-libcurl by everforward on Monday January 29, 2024 @02:40PM (#39181359)
> if anything, curl will only add ones for you.

That's kind of what I mean. E.g. I believe curl will add a Content-Length header, which is good to have, but I don't need every example HTTP call to show me that.

To me a curl call is kind of shorthand for "these are the parts unique to this request, do the appropriate thing for general-use headers". If I see a raw HTTP request missing a Content-Length header (assuming it could use one), I don't know whether to assume that I do the normal thing, or whether the server ignores Content-Length, or perhaps if the server specifically errors out when it's set.

Vice-versa, if a raw HTTP request does have a Content-Length header, I'm not sure if that means it's required or just supported.

If I see a curl call specifying Content-Length, it sets off the "something weird is going on" bells in my head. Nobody specifies that in curl, so it's presence is odd and worth looking at.