4 ms·
What's the problem with sending "Content-Length: 0" as part of the PUT headers?
by BrandonM 16y ago
What's the problem with sending "Content-Length: 0" as part of the PUT headers?
- jrockway 16y agoBrowsers?
- BrandonM 16y agoIf this is the case, I think the article could have made it more clear that the problem was with software not under the author's control. All the article mentions is "the application registering the device," and I assumed that it was their application which was not sending the header. So a browser won't send a Content-Length header for a PUT request if there is no body? I'm not criticizing the article itself; it was a nice beginner guide to making quick changes to an existing C project. My only criticism is that the first step when considering whether to make a change to a code base is to fully evaluate whether that change is appropriate, if it is fixing the problem in the right place. Perhaps the author did this and the article simply failed to mention it.
- riffraff 16y agodo browser support put at all?
- dowskitest 16y agoYes. Most browsers support all of the HTTP methods via the XmlHttpRequest object. http://annevankesteren.nl/2007/10/http-method-support http://annevankesteren.nl/2007/10/http-method-support
- schmichael 16y agoThe good news is that browsers aren't the issue for us at Urban Airship. The bad news is that it's worse: it's an infinite number of HTTP libraries of varying quality that hit our API. Some from pretty much every imaginable platform capable of HTTP: from mobile devices to VBA in Microsoft Access: http://help.urbanairship.com/discussions/questions/161-using-vba-to-trigger-notification http://help.urbanairship.com/discussions/questions/161-using... If the HTTP standard allows it, we probably need to support it (or degrade in a standards compliant way) because someone will try to use it.
- IgorPartola 16y agoOr sending a small meaningless body? On the other hand, he got to play with C which is often fun.
- schmichael 16y agoA couple of reasons: 1. The pragmatic one - our current web server doesn't require hacks like that, so there's lots of existing code out of our control that would break. 2. The pedantic one - at Urban Airship we try to offer as standards compliant a RESTful HTTP API as possible. Asking our users to work around shortcomings in our system is something we avoid as much as possible.