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 7640827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:46:02+00:00 2026-05-31T08:46:02+00:00

I am trying to debug an http post the I am trying to send

  • 0

I am trying to debug an http post the I am trying to send from list application. I have been able to send the correct post from php CURL which corectly interfaces with my drupal 7 website and uploads an image.

In order to get this to work in my lisp application I really need to see the content body of my http post I have been able to see the headers using a call like this:

curl_setopt($curl,   CURLOPT_STDERR, $fp);
curl_setopt($curl, CURLOPT_VERBOSE, 1);

and the headers look the same in my lisp application but I have been unable to examine the body of the post. I have searched online and other people have asked this question but no one posted a response.

The content type of my http post is:

application/x-www-form-urlencoded

I have also tried many http proxy debuging tools but they only ever the http GET to get my php page but never capture the get sent from server once the php code is executed.

EDIT: I have added a code snipet showing where I actually upload the image file.

// file
$file = array(
  'filesize' => filesize($filename),
  'filename' => basename($filename),
  'file' => base64_encode(file_get_contents($filename)),
  'uid' => $logged_user->user->uid,
);

$file = http_build_query($file);

// REST Server URL for file upload
$request_url = $services_url . '/file';

// cURL
$curl = curl_init($request_url);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-type: application/x-www-form-urlencoded'));
curl_setopt($curl,   CURLOPT_STDERR, $fp);
curl_setopt($curl, CURLOPT_VERBOSE, 1);
curl_setopt($curl, CURLOPT_POST, 1); // Do a regular HTTP POST
curl_setopt($curl, CURLOPT_POSTFIELDS, $file); // Set POST data
curl_setopt($curl, CURLOPT_HEADER, FALSE);  // Ask to not return Header
curl_setopt($curl, CURLOPT_COOKIE, "$cookie_session"); // use the previously saved session
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_FAILONERROR, TRUE);
curl_setopt_array($curl, array(CURLINFO_HEADER_OUT => true) );
$response = curl_exec($curl);
  • 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-31T08:46:04+00:00Added an answer on May 31, 2026 at 8:46 am

    CURLOPT_VERBOSE should actually show the details. If you’re looking for the response body content, you can also use CURLOPT_RETURNTRANSFER, curl_exec() will then return the response body.

    If you need to inspect the request body, CURLOPT_VERBOSE should give that to you but I’m not totally sure.

    In any case, a good network sniffer should give you all the details transparently.

    Example:

    $curlOptions = array(
        CURLOPT_RETURNTRANSFER => TRUE,
        CURLOPT_FOLLOWLOCATION => TRUE,
        CURLOPT_VERBOSE => TRUE,
        CURLOPT_STDERR => $verbose = fopen('php://temp', 'rw+'),
        CURLOPT_FILETIME => TRUE,
    );
    
    $url = "http://stackoverflow.com/questions/tagged/java";
    $handle = curl_init($url);
    curl_setopt_array($handle, $curlOptions);
    $content = curl_exec($handle);
    echo "Verbose information:\n", !rewind($verbose), stream_get_contents($verbose), "\n";
    curl_close($handle);
    echo $content;
    

    Output:

    Verbose information:
    * About to connect() to stackoverflow.com port 80 (#0)
    *   Trying 64.34.119.12...
    * connected
    * Connected to stackoverflow.com (64.34.119.12) port 80 (#0)
    > GET /questions/tagged/java HTTP/1.1
    Host: stackoverflow.com
    Accept: */*
    
    < HTTP/1.1 200 OK
    < Cache-Control: private
    < Content-Type: text/html; charset=utf-8
    < Date: Wed, 14 Mar 2012 19:27:53 GMT
    < Content-Length: 59110
    < 
    * Connection #0 to host stackoverflow.com left intact
    
    <!DOCTYPE html>
    <html>
    
    
    
    <head>
    
    
    
        <title>Newest &#39;java&#39; Questions - Stack Overflow</title>
        <link rel="shortcut icon" href="http://cdn.sstatic.net/stackoverflow/img/favicon.ico">
        <link rel="apple-touch-icon" href="http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png">
        <link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="/opensearch.xml">
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to follow the example in this post . Since I
I'm trying to debug a deadlock in a multi-threaded Python application after it has
I'm trying to debug an application (under PostgreSQL) and came across the following error:
I am trying to debug a strange issue with users that have LogMeIn installed.
I've started to add HTTP support to a custom C# non-webserver application which seems
I am trying to send data over to a cakephp (mvc) website, via $.post().
I'm trying to implement a simple HTTP server in Android that handles POST requests,
I'm trying to compile SQLCipher. I've downloaded source code from http://sqlcipher.net/ . Then I'm
I am trying to learn javascript/jquery, using firebug to debug and have built a
seeing this blog post : http://mine.tuxfamily.org/?p=111 , I'm trying to disable the pivot flick

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.