New to Fiddler on Windows 7 - Need Insights (CURL, PHP)

3 posts, 0 answers
  1. Casey
    Casey avatar
    2 posts
    Member since:
    Feb 2015

    Posted 10 Feb 2015 Link to this post

    I've installed Fiddler on my Windows 7 machine and I'm trying to execute the following PHP CURL routine so that I can see the POST request body in Fiddler:

    01.$proxy = 'http://localhost:8888';
    02. 
    03.$ch = curl_init();
    04.$curlConfig = array(
    05.    CURLOPT_URL             => "http://localhost/projects/curl_1/test.php",
    06.    CURLOPT_POST                    => true,
    07.    CURLOPT_RETURNTRANSFER  => true,
    08.    CURLOPT_PROXY           => $proxy,
    09.    CURLOPT_HTTPPROXYTUNNEL => true,
    10.    CURLOPT_POSTFIELDS      => array(
    11.        'test1' => 'blah',
    12.        'test2' => 'more blah',
    13.    )
    14.);
    15.curl_setopt_array($ch, $curlConfig);
    16.$result = curl_exec($ch);

    Whenever I visit the page, however, all I see in Fiddler is a GET request--not a POST request.

    What do I need to do / configure in Fiddler to see the POST requests? I don't have the HTTPS Decryption enabled but that's because I shouldn't need to enable it for basic HTTP debugging (I'm not working with any SSL projects at the moment).
  2. Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 10 Feb 2015 Link to this post

    Hello, Casey--

    You're seeing the GET request from your browser, and not seeing the request from the backend server process.

    The likely problem here is that you've set CURLOPT_HTTPPROXY_TUNNEL which could be named CURLOPT_DO_NON_STANDARD_CRAZINESS_AND_DONT_USE_PROXY_PROPERLY.

    Unset that option.

    If you're still having problems, try leaving the option unset and change the target URL to http://doesnotexist.example.com/projects/curl_1/test.php. Do you see the request then?

    Regards,
    Eric Lawrence
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Casey
    Casey avatar
    2 posts
    Member since:
    Feb 2015

    Posted 10 Feb 2015 in reply to Eric Lawrence Link to this post

    Eric, your first suggestion did it. I'm FINALLY seeing POSTs! Thank you so much!

    (And major props for the quick response.)
Back to Top