PHP Classes
elePHPant
Icontem

File: post_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  >  post_test.php  >  Download  
File: post_test.php
Role: Example script
Content type: text/plain
Description: Post 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: 13 years ago
Size: 789 bytes
 

Contents

Class file image Download
<?php
require_once( 'http.inc' );
header( 'Content-Type: text/plain' );

$form = array(
               
'value' => 1,
               
'date' => '05/20/02',
               
'date_fmt' => 'us',
               
'result' => 1,
               
'lang' => 'eng',
               
'exch' => 'USD',
               
'Currency' => 'EUR',
               
'format' => 'HTML',
               
'script' => '../convert/fxdaily',
               
'dest' => 'Get Table'
           
);

   
$http_client = new http( HTTP_V11, true );
   
$http_client->host = 'www.oanda.com';
   
$status = $http_client->post( '/convert/fxdaily', $form, 'http://www.oanda.com/convert/fxdaily' );
    if (
$status == HTTP_STATUS_OK ) {
        print(
$http_client->get_response_body() );
    } else {
        print(
"An error occured while requesting your file !\n" );
       
print_r( $http_client );
    }
   
$http_client->disconnect();
    unset(
$http_client );

?>