Curl is working correctly, I'm posting and getting a response.
However, the response is not what I expected. How do I output the raw HTML POST request, and the raw response?

I'm sure I'm missing something simple, but I need this info to continue debugging.

Thanks a million!

    if you can post your curl request code, I can look at ways to add debugging info for you.

      Here's the code. It's actually C++ but if you can give me the PHP debug info I can translate it without too much trouble.

      Thanks!

      int CWebGrabber::GetSSLURLPost(std::string host, unsigned int port,
                std::string urlin, std::stringstream& content,
      	  std::string postdata, std::string referer)
      {
        CurlMemory chunk;
        chunk.memory = NULL;
        chunk.size = 0;
      
        std::stringstream url;
        url << "https://";
       url << host;
       url << urlin;
      
       CURL* curl = curl_easy_init();
        curl_easy_setopt(curl, CURLOPT_URL, url.str().c_str());
        curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L);
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeCurlData);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, &chunk);
        curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.5");
        curl_easy_setopt(curl, CURLOPT_REFERER, referer.c_str());
        curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
        curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postdata.c_str());
        curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, postdata.size());
        curl_easy_setopt(curl, CURLOPT_POST, 1L);
        curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
      
        const int timeout = 30000;
        curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout/1000);
      
        CURLcode curlError = curl_easy_perform(curl);
        curl_easy_cleanup(curl);
      
        if (chunk.memory)
        { 
          content << chunk.memory;
          free(chunk.memory);
          chunk.memory = NULL;
        }
      
       if (content.str().size() == 0)
        {
          std::stringstream error;
          error << "Could not load " << url.str();
          error << ".  Error message = " << curl_easy_strerror(curlError);
          throw std::runtime_error(error.str());
        }
      
        return content.str().size() > 0;
      }
        12 days later
        Write a Reply...