www.webdeveloper.com
Results 1 to 2 of 2

Thread: How to Get Ping Result from RPC URL

  1. #1
    Join Date
    Oct 2013
    Posts
    9

    How to Get Ping Result from RPC URL

    Hello Dear Webmaster,
    Request help to get Response when using Ping to URL

    here the CURL Code

    PHP Code:
        $c curl_init();
        
    curl_setopt($cCURLOPT_URL,'http://blogsearch.google.com/ping/RPC2');
        
    curl_setopt($cCURLOPT_RETURNTRANSFER1);
        
    curl_setopt($cCURLOPT_FOLLOWLOCATION1);
        
    curl_setopt($cCURLOPT_POSTTRUE);
        
    curl_setopt($cCURLOPT_USERAGENT"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
        
    curl_setopt($cCURLOPT_POSTFIELDS$message);
        
    $content trim(curl_exec($c));
        echo 
    $content;
        
    curl_close($c); 
    this step done success with response
    flerror0 messageThanks for the ping.

    but now I want to get xml from http://blogsearch.google.com/ping/RPC2 here the result

    PHP Code:
    This XML file does not appear to have any style information associated with itThe document tree is shown below.
    <
    methodResponse>
    <
    params>
    <
    param>
    <
    value>
    <
    struct>
    <
    member>
    <
    name>flerror</name>
    <
    value>
    <
    boolean>1</boolean>
    </
    value>
    </
    member>
    <
    member>
    <
    name>message</name>
    <
    value>Unable to parse XML-RPC request.</value>
    </
    member>
    </
    struct>
    </
    value>
    </
    param>
    </
    params>
    </
    methodResponse
    I am trying add url http://blogsearch.google.fi/ping/RPC...mywebsite.com/

    but still error find.
    any idea how to get result ping after curl_exec?

    Thank your for helping me

  2. #2
    Join Date
    Jul 2012
    Location
    Vancouver
    Posts
    61
    You need to set the proper headers in your request as it's not being sent in the proper method.. also you'll need to make sure the POSTFIELDS are encoded properly.. This would be a good place to start
    PHP Code:
    $header = array();
    $header[] = "Content-type: text/xml";
    $header[] = "Content-length: ".strlen($message) . "\r\n";

    curl_setopt$cCURLOPT_HTTPHEADER$header ); 
    Last edited by mistin.ca; 12-13-2013 at 06:49 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles