AFNetworking Enable GZIP

前端 未结 2 1123
陌清茗
陌清茗 2021-02-13 02:56

I am looking on the AFNetworking site that GZIP compression is supported \" Gzip decompression from server responses is already built into AFNetworking, as NSURLConnection will

相关标签:
2条回答
  • 2021-02-13 03:47

    AFAIK NSURLConnection uses gzip decompresson by default and AFNetworking builds on the top of NSURLConnection. So, you shouldn't have to enable it.

    0 讨论(0)
  • 2021-02-13 03:56

    It seems you need to add a HTTP header :

    [self setDefaultHeader:@"Accept-Encoding" value:@"gzip"]

    To the AfNetworking HTTP client.

    0 讨论(0)
提交回复
热议问题