Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
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

Releases

No releases published

Packages

No packages published

Languages