php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #79097 CURLOPT_HTTP_CONTENT_DECODING is not documented
Submitted: 2020-01-11 03:16 UTC Modified: 2020-01-12 10:11 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: 839325966 at qq dot com Assigned: cmb (profile)
Status: Closed Package: cURL related
PHP Version: 7.2.26 OS: centos 7.7
Private report: No CVE-ID: None
 [2020-01-11 03:16 UTC] 839325966 at qq dot com
Description:
------------
when set CURLOPT_ENCODING "gzip", can't get raw data responsed.

Test script:
---------------
<?php

$url = "https://bugs.php.net/report.php";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_ENCODING, 'gzip, deflate');
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
$responseBody = curl_exec($curl);
$headerArray = curl_getinfo($curl);
if (strlen($responseBody) != $headerArray['size_download'])
{
	printf("error, response data length:%d, download size:%d\n", strlen($responseBody), $headerArray['size_download']);
}


Expected result:
----------------
reuse CURLOPT_BINARYTRANSFER suggest


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-01-11 14:15 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2020-01-11 14:15 UTC] cmb@php.net
You have to add

  curl_setopt($curl, CURLOPT_HTTP_CONTENT_DECODING, false);

CURLOPT_HTTP_CONTENT_DECODING is available as of PHP 5.5.0 if
built against libcurl >= 7.16.2.  Since this is not documented,
changing to doc bug.
 [2020-01-11 14:15 UTC] cmb@php.net
-Type: Bug +Type: Documentation Problem
 [2020-01-12 10:11 UTC] cmb@php.net
-Summary: when set CURLOPT_ENCODING "gzip", can't get raw data responsed +Summary: CURLOPT_HTTP_CONTENT_DECODING is not documented -Assigned To: +Assigned To: cmb
 [2020-01-12 10:11 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=348881
Log: Fix #79097: CURLOPT_HTTP_CONTENT_DECODING is not documented
 [2020-01-12 10:11 UTC] cmb@php.net
-Status: Verified +Status: Closed
 [2020-01-12 10:15 UTC] salathe@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=4c8ead4567b256fa6ef847c640e8f0b4016ed934
Log: Fix #79097: CURLOPT_HTTP_CONTENT_DECODING is not documented
 [2020-01-12 14:35 UTC] mumumu@php.net
Automatic comment from SVN on behalf of mumumu
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=348885
Log: Fix #79097: CURLOPT_HTTP_CONTENT_DECODING is not documented

Bug: https://bugs.php.net/79097 (Verified) CURLOPT_HTTP_CONTENT_DECODING is not documented
 [2020-02-07 06:04 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=25cfe14df1f1c1547075886abff151c284805fb4
Log: Fix #79097: CURLOPT_HTTP_CONTENT_DECODING is not documented
 [2020-12-30 11:59 UTC] nikic@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=59882627f7ce69396e71d25ffc92bc63deb99a21
Log: Fix #79097: CURLOPT_HTTP_CONTENT_DECODING is not documented
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 16:01:30 2025 UTC