====== JResponse ====== {#JAPI Joomla.Framework Environment JResponse #} JResponse Class
This class serves to provide the Joomla Framework with a common interface to access response variables. This includes header and body.
===== Methods ===== ^ Method ^ Description ^ | [[JResponse-allowCache|{{references:Method.png?nolink}}]] [[JResponse-allowCache|allowCache]] | Set/get cachable state for the responseIf $allow is set, sets the cachable state of the response. Always returns current state
| | [[JResponse-appendBody|{{references:Method.png?nolink}}]] [[JResponse-appendBody|appendBody]] | Append content to the body content | | [[JResponse-clearHeaders|{{references:Method.png?nolink}}]] [[JResponse-clearHeaders|clearHeaders]] | Clear headers | | [[JResponse-getBody|{{references:Method.png?nolink}}]] [[JResponse-getBody|getBody]] | Return the body content | | [[JResponse-getHeaders|{{references:Method.png?nolink}}]] [[JResponse-getHeaders|getHeaders]] | Return array of headers; | | [[JResponse-prependBody|{{references:Method.png?nolink}}]] [[JResponse-prependBody|prependBody]] | Prepend content to the body content | | [[JResponse-sendHeaders|{{references:Method.png?nolink}}]] [[JResponse-sendHeaders|sendHeaders]] | Send all headers | | [[JResponse-setBody|{{references:Method.png?nolink}}]] [[JResponse-setBody|setBody]] | Set body contentIf body content already defined, this will replace it.
| | [[JResponse-setHeader|{{references:Method.png?nolink}}]] [[JResponse-setHeader|setHeader]] | Set a headerIf $replace is true, replaces any headers already defined with that $name.
| | [[JResponse-toString|{{references:Method.png?nolink}}]] [[JResponse-toString|toString]] | Sends all headers prior to returning the string | | [[JResponse-_compress|{{references:Method.png?nolink}}]] [[JResponse-_compress|_compress]] | Compress the dataChecks the accept encoding of the browser and compresses the data before sending it to the client.
| ---- ~~DISCUSSION~~