FAQ
I'd like to be able to disable the 'dechunking' of chunked responses
so that I get the raw response after the headers (i.e. I want to be
able to see the chunks). Is there a way to do this?

John.

--

Search Discussions

  • Dustin Sallings at Nov 14, 2012 at 2:56 am
    John Graham-Cumming <jgrahamc@gmail.com>
    writes:
    I'd like to be able to disable the 'dechunking' of chunked responses
    so that I get the raw response after the headers (i.e. I want to be
    able to see the chunks). Is there a way to do this?
    Certainly the easiest way to do this would be to create an
    http.Request and write it to a socket and read until an empty line
    (using Request.Write).

    I think any http response reader that sees chunked will give you a
    body that compensates for both chunked and content length
    automatically. But reading the response is pretty straightforward.
    net/textproto can handle much of it for you if you actually do want
    access to the headers.

    Also: Why do you want the chunk info? That *feels* like you might be
    doing something weird.

    --
    dustin

    --
  • John Graham-Cumming at Nov 14, 2012 at 3:25 am

    On Nov 14, 2:56 am, Dustin Sallings wrote:
    I think any http response reader that sees chunked will give you a
    body that compensates for both chunked and content length
    automatically.  But reading the response is pretty straightforward.
    net/textproto can handle much of it for you if you actually do want
    access to the headers.
    Yes, I think what I need is net/textproto.
    Also:  Why do you want the chunk info?  That *feels* like you might be
    doing something weird.
    I am doing something weird. I work on a special HTTP proxy that is
    doing compression of HTTP response bodies. Ideally I want those in the
    most non-munged fashion so that I reduce buffering.

    John.

    --
  • Paulchang at Dec 7, 2012 at 11:41 pm
    I'm also interested in getting raw access to the chunks, but don't want to
    reimplement the rest of HTTP with a raw socket or net/textproto. It seems
    like making the chunkedReader from pkg/net/http/chunked.go a public type
    might make this easier, since then I can reach the underlying Reader.

    Would a change to the standard library like that make sense?

    (I would also like to proxy HTTP with low latency.)

    -- paul
    On Tuesday, November 13, 2012 9:00:02 PM UTC-5, John Graham-Cumming wrote:

    I'd like to be able to disable the 'dechunking' of chunked responses
    so that I get the raw response after the headers (i.e. I want to be
    able to see the chunks). Is there a way to do this?

    John.
    --

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 14, '12 at 1:59a
activeDec 7, '12 at 11:41p
posts4
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase