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

Compressed (gzip) PUT and POST request body #370

Open
lnjuanj opened this issue Apr 12, 2018 · 3 comments
Open

Compressed (gzip) PUT and POST request body #370

lnjuanj opened this issue Apr 12, 2018 · 3 comments
Assignees

Comments

@lnjuanj
Copy link

lnjuanj commented Apr 12, 2018

Hi,
First of all, this API is amazing! One single file and so much power :)
I would like to send compressed gzip content through POST and PUT requests (I send posts with tens or hundreds of objects, hence compression would be a great feature). I see the API does not support this by default.
How do you recommend doing this? I guess the best thing would be checking the headers and if 'Content-Encoding' contains 'gzip' --> uncompress before managing the data.
I would like to:

  • Either introduce this into my config file
  • Have it in the php-crud-api repo.
    Otherwise, I would have a library/file that could not be updated anymore as easily.
    I thought I could use the 'before' function but I see I wouldn't have access to the headers from there.
    Please advice me about this.
    Thanks!
@mevdschee mevdschee reopened this Apr 12, 2018
@mevdschee
Copy link
Owner

mevdschee commented Apr 12, 2018

I would like to send compressed gzip content through POST and PUT requests

Sounds like a good feature request.

I guess the best thing would be checking the headers

Probably not needed. This should be easily detectable from the input data itself based on the first two bytes (a magic number):

a 10-byte header, containing a magic number (1f 8b), compression id, file flags, a timestamp, compression flags and operating system id.

See: https://en.wikipedia.org/wiki/Gzip

@mevdschee mevdschee self-assigned this Apr 12, 2018
@mevdschee mevdschee changed the title Question: compressed (gzip) PUT and POST Compressed (gzip) PUT and POST request body Apr 12, 2018
@keytrap-x86
Copy link

@mevdschee That would be great !

@mevdschee
Copy link
Owner

Okay.. but how do I test? Is there a client that sends gzip content? What is your use case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants