-
Notifications
You must be signed in to change notification settings - Fork 1
rioastamal/rayap
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About ===== Rayap is a PHP based Object oriented wrapper for most of curl functions. It simplify and making the use of curl very easy. Here is simple example how to use Rayap. === Simple GET Request === <?php // include the class include_once('rayap.php'); // instance the class $rayap = new Rayap(); // fetch a page (using GET) $result = $rayap->get_page('http://www.google.com/'); // close the connection $rayap->close(); // print result echo $result; ?> === Simple POST Request === <?php // include the class include_once('rayap.php'); // instance the class $rayap = new Rayap('http://example.com/login.php'); // set request method to POST $rayap->method = 'POST'; // just to make sure we follow the redirection $rayap->always_follow = TRUE; // build the post data $data = array( 'username' => 'foo', 'password' => 'bar', 'submit' => 'Login' ); $rayap->set_postdata($data); // ok, now shot the URL $result = $r->exec(); // close the connection $rayap->close(); // print the result echo $result; ?> Sounds easy right? :). ----------------------- Copyright 2008 Rio Astamal (me@rioastamal.net)
About
Curl Wrapper for PHP
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published