Search code examples
phppostgethttprequestsnoopy

Submitting Data via GET with "Snoopy" in PHP


I'm trying to send data to a url via GET in PHP. I've decided to go with the Snoopy Class after receiving an answer to another question here. The thing is, I cannot seem to find very good documentation/examples for the methods in this class.

I see the ->httprequest() method, but I don't see where I can add an array of values along with the request.

Anybody a bit more familiar able to lend a hand?


Solution

  • $vars = array( "fname" => "Jonathan", "lname" => "Sampson" );
    $snoopy = new Snoopy();
    
    $snoopy->httpmethod = "GET"; // is GET by default
    $snoopy->submit( "http://www.example.com", $vars );
    print $snoopy->results;