Curl Wrapper for PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README
rayap.php

README

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)