Streaming HTTP responses is very important when downloading really large
files (e.g., Amazon S3 objects that are gigabytes). By forcing it into a
stream, you are forcing it into memory. I don't think there should be a
`getBodyAsString()` method though.


On Sun, Aug 25, 2013 at 5:46 AM, Marco Pivetta <notifications@github.com>wrote:

> In proposed/http.md:
>
> > +     * @return self Reference to the message.
> > +     *
> > +     * @throws InvalidArgumentException When part of the header set is not valid.
> > +     */
> > +    public function addHeaders(array $headers);
> > +
> > +    /**
> > +     * Gets the body.
> > +     *
> > +     * This returns the original form, in contrast to `getBodyAsString()`.
> > +     *
> > +     * @return mixed|null Body, or null if not set.
> > +     *
> > +     * @see getBodyAsString()
> > +     */
> > +    public function getBody();
>
> Not sure why the body of an HTTP message would be anything different from
> a string. In HTTP, it's always a string, the fact that it's json encoded or
> url encoded is a different matter that can be handled in getDecodedBodyor something similar.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/php-fig/fig-standards/pull/72/files#r5968277>
> .
>