PHP Classes
elePHPant
Icontem

File: get_test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of GuinuX  >  Advanced HTTP Client  >  get_test.php  >  Download  
File: get_test.php
Role: Example script
Content type: text/plain
Description: Get example script
Class: Advanced HTTP Client
GET, HEAD, POST methods with a lot of features
Author: By
Last change: Applied change for release 1.1 of the class
Date: 12 years ago
Size: 626 bytes
 

Contents

Class file image Download
<?php

/*********************************************************************
 * Demonstrates the use of the get() method
 *********************************************************************/
   
require_once( 'http.inc' );
   
header( 'Content-Type: text/xml' );
   
   
// Grab a RDF file from phpdeveloper.org and display it
   
$http_client = new http( HTTP_V11, false);
   
$http_client->host = 'www.phpdeveloper.org';
   
    if (
$http_client->get( '/phpdev.rdf' ) == HTTP_STATUS_OK)
        print(
$http_client->get_response_body() );
    else
        print(
'Server returned ' . $http_client->status );

    unset(
$http_client );

?>