Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6832577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:52:31+00:00 2026-05-26T22:52:31+00:00

I am getting some info from a https web server using PHP plus cURL.

  • 0

I am getting some info from a https web server using PHP plus cURL. All info got as HTTP GET is ok but when I need to do some HTTP POST I get a no sense output. Web server is ok as If i get the info from a web browser all works ok.

I am using following code:

curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); 
curl_setopt($ch, CURLOPT_HEADER, 1); 
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1"); 

if($method == "POST"){
    print_r($post_fields);
    curl_setopt($ch, CURLOPT_POST, true); 
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);     
    curl_setopt($ch,CURLOPT_HTTPHEADER, array (
        "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
        "Accept-Language: es-es,es;q=0.8,en-us;q=0.5,en;q=0.3",
        "Accept-Encoding: gzip, deflate",
        "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7"
    ));
}

if ($usecookie) { 
    curl_setopt($ch, CURLOPT_COOKIEJAR, $usecookie); 
    curl_setopt($ch, CURLOPT_COOKIEFILE, $usecookie);    
} 

if ($refer != "") { 
    curl_setopt($ch, CURLOPT_REFERER, $refer ); 
} 

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); 

Answer header is:

HTTP/1.1 200 OK
Date: Sun, 20 Nov 2011 11:04:39 GMT
Server: Apache
Cache-Control: must-revalidate
Pragma: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
max-age: Thu, 01 Jan 1970 00:00:00 GMT
X-Powered-By: Servlet/2.4 JSP/2.0
idWl: PRO-LOW16_6604
Vary: Accept-Encoding
Content-Encoding: gzip
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

Any idea about where the problem could be?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:52:32+00:00Added an answer on May 26, 2026 at 10:52 pm

    It clearly shows its gziped…

    Content-Encoding: gzip
    Transfer-Encoding: chunked
    

    Passing the returned data through the below function will inflate it back to readable content.

    function gzdecoder($d){
        $f=ord(substr($d,3,1));
        $h=10;$e=0;
        if($f&4){
            $e=unpack('v',substr($d,10,2));
            $e=$e[1];$h+=2+$e;
        }
        if($f&8){
            $h=strpos($d,chr(0),$h)+1;
        }
        if($f&16){
            $h=strpos($d,chr(0),$h)+1;
        }
        if($f&2){
            $h+=2;
        }
        $u = gzinflate(substr($d,$h));
        if($u===FALSE){
            $u=$d;
        }
        return $u;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting some info from an RSS. <?php $dom = new DOMDocument; libxml_use_internal_errors(TRUE);
I'm getting some objects from an external library and I need to store those
I'm getting some really wierd linking errors from a class I wrote. I am
I am getting some junk data returned from a ToString() call on a DateTime
I'm getting some very jerky scrolling while using the code below to create a
I have tried following the FB mobile web getting started guide at: https://developers.facebook.com/docs/guides/mobile/web/ for
I am trying to create CGImage from NSTextField. I got some success in this.
I'm a novice/beginner programmer having problems getting some simple client/server C code working. My
Currently, I'm using AjaxPro Framework ( http://www.ajaxpro.info/ ) to call any methods in my
I'm using rJava to speak to the Amazon Web Services Java API from inside

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.