Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for request compression #988

Closed
robingustafsson opened this issue Apr 5, 2019 · 0 comments · Fixed by #989
Closed

Add support for request compression #988

robingustafsson opened this issue Apr 5, 2019 · 0 comments · Fixed by #989
Assignees
Labels

Comments

@robingustafsson
Copy link
Member

robingustafsson commented Apr 5, 2019

When sending HTTP requests there's currently no easy way to compress the contents of the body. I propose we add compression support via a request option as follows:

http.post("https://example.com/api-expecting-gzip", "{key:value}",
  { compression: "gzip", headers: {"Content-type": "application/json"} });

This would:

  • Compress the request body using the specified compression algorithm (gzip is enough initially)
  • Make sure the correct Content-encoding and Content-length is set
@robingustafsson robingustafsson added this to the v1.0.0 milestone Apr 5, 2019
@mstoykov mstoykov self-assigned this Apr 5, 2019
mstoykov added a commit that referenced this issue Apr 8, 2019
This adds `compression` param to all http methods with only current
possible value `gzip` that will compress the body set the correct
`Content-Encoding` and `Content-Length` and will send the request with
the compressed body.
mstoykov added a commit that referenced this issue Apr 8, 2019
mstoykov added a commit that referenced this issue Apr 10, 2019
@na-- na-- removed this from the v1.0.0 milestone Jul 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants