Unzip the contents of gzip using curl

Source: Internet
Author: User

Haven't written a blog for a long time, today, a whim, record a problem solved today.


After Curl set the curlopt_accept_encoding (7.21.8 before curlopt_encoding ) , according to the official saying, Is can automatically respond to the gzip compressed content decompression, but my project did not decompress, and online A search is also a large number of people ask this question, and the answer is actually said can be automatically extracted. I was bored.


The Curl library in my project was compiled by myself, I went to see the Config.log, search zlib incredibly see With-zlib is disable, then understand, download Zlib library, first compiled, and then in the Curl project configure with-with-zlib= parameters, Pit dad is, It must also go to the directory you set up to find the Include directory and then to your change file, find Lib directory and then go to find libz.a, and zlib in the library exactly no such directory structure, then build it yourself.


Then compile curl, the project set curlopt_accept_encoding to gzip, the response is sure to automatically unzip the smooth, O.


Unzip the contents of gzip using curl

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.