The setCompressed() method of the HttpRequest class appears to do just that (apply gzip compression to the request body). If true, the data in the body is delivered to the endpoint in the gzip compressed format. If false, no compression format is used.