react-native icon indicating copy to clipboard operation
react-native copied to clipboard

[Android] fetch with Accept-encoding gzip does not work

Open PhilippKrone opened this issue 11 years ago • 7 comments

Hello,

it seems as if fetch does not work with Accept-encoding in Android, where as it does work in IOS. If you need an example, I'm happy to make one, but the issue is quite self-explanatory I think. :)

Regards Philipp

PhilippKrone avatar Oct 21 '15 15:10 PhilippKrone

https://productpains.com/post/react-native/fetch-with-accept-encoding-gzip-does-not-work/

ccheever avatar Dec 17 '15 06:12 ccheever

+1

urquilla avatar Mar 11 '16 18:03 urquilla

Ok I made some tests, I expected to need some explicit configuration to enable gzipping, which I didn't found documented. But observing the traffic I note Accept-Encoding: gzip was sent without any special configuration.

The response came gzipped and was decoded and parsed correctly. So it's working ok for me.

This on react native v0.18.0

[..]
Hypertext Transfer Protocol
    HTTP/1.0 200 OK\r\n
        [Expert Info (Chat/Sequence): HTTP/1.0 200 OK\r\n]
        Request Version: HTTP/1.0
        Status Code: 200
        Response Phrase: OK
    Date: Fri, 11 Mar 2016 19:33:58 GMT\r\n
    Server: Mono.WebServer.XSP/3.8.0.0 Linux\r\n
    Content-Encoding: gzip\r\n
    X-AspNet-Version: 4.0.30319\r\n
    Content-Length: 475\r\n
    Expires: -1\r\n
    Pragma: no-cache\r\n
    Cache-Control: no-cache\r\n
    Content-Type: application/json; charset=utf-8\r\n
   [...]

urquilla avatar Mar 11 '16 20:03 urquilla

Hi there! This issue is being closed because it has been inactive for a while.

But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/android-fetch-with-accept-encoding-gzip-does-not-work

ProductPains helps the community prioritize the most important issues thanks to its voting feature. It is easy to use - just login with GitHub. GitHub issues have voting too, nevertheless Product Pains has been very useful in highlighting the top bugs and feature requests: https://productpains.com/product/react-native?tab=top

Also, if this issue is a bug, please consider sending a pull request with a fix. We're a small team and rely on the community for bug fixes of issues that don't affect fb apps.

mkonicek avatar Jul 29 '16 23:07 mkonicek

is this resolved ?? i still get this issue

sanathp avatar Jun 02 '17 23:06 sanathp

Same

dorthwein avatar Aug 09 '17 14:08 dorthwein

Same question https://stackoverflow.com/questions/46433923/axios-could-not-support-gzip-when-use-reactnative-in-android

kala888 avatar Sep 27 '17 02:09 kala888