PEAR HTTP Request
From Triangle Wiki
{{Wrapper|NavigationFile=
- Overview
- Archive Zip
- Benchmark
- Calendar
- Date
- DB
- DataObject
- Formbuilder
- Quickform
- HTML Page 2
- HTML Table
- HTTP Download
- HTTP Request
- HTTP Upload
- Log
- Mail Mime
- MDB2
- FTP
- Pager
- PHPDoc
- Exchange Rates
- Tempate Sigma
- Datagrid
- CAPTCHA
- Translation 2
- PEAR Site|PageContent=
Contents |
Introduction
This page is created to bring together examples and knowledge from other resources. Providing real world tutorials for HTTP_request in a WIKI format for all users to contribute.
Provides an easy way to perform HTTP requests from within PHP scripts. Supports GET / POST / HEAD / TRACE / PUT / DELETE, Basic authentication, Proxy, Proxy Authentication, SSL, file uploads etc.
Because of the above mentioned features HTTP_Request makes it possible to mimic big parts of web browsers such as the widely-known Mozilla browser in PHP applications. Possible application areas are:
- Checking the validity of WWW links with the help of getResponseCode().
- Grabbing remote web pages and parsing the result.
Methods
addPostData
if ($params['method'] == 'POST') {
foreach ($url_string as $k => $v) {
$req->addPostData($k, $v);
}
}
Examples
Hello World Example
<?php require_once 'HTTP/Request.php'; $req =

