home.social

#requestheader — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #requestheader, aggregated by home.social.

fetched live
  1. I was sure I wasn't asking for GZipped response bodies. So I looked up the #HTTP RFC once more for the #AcceptEncoding #requestHeader. It lets us set the kinds of encoding we like (compress, deflate, etc.) and also set a quality indicator.

    If set to 0 for an encoding, we tell the remote server not to supply it.

    Yay!

    Or not: the remote REST API server I was addressing responded, saying they didn't like my Accept-Encoding header.

    So… then what?

  2. Yesterday was the first time in years a remote #REST #API server required me to send the #ContentLength #requestHeader. The #HTTP component I was using, #HttpURLConnection by Sun, outright refused to set it.

    I looked up the HTTP RFC: yes, it is called Content-Length, and yes, it's a count of 16-bit characters. And it can be used only if neither streaming nor chunking the contents. My code met those requirements.

    What was going on?