## /http_get.php

Description

This script implements utility functions for retrieving data using HTTP requests.

- license: Phorum
- copyright: 2007, Phorum Development Team

Functions
phorum_api_http_get (line 58)

This function can be used to retrieve data from a URL using an HTTP GET request.

The way in which data can be retrieved for URLs, depends a lot on the features and the configuration for PHP on the system. This function will try to autodetect a way that will work for the running system automatically.

- return: The data that was loaded from the URL or NULL if an error occurred. The function phorum_api_strerror() can be used to retrieve information about the error which occurred.

string phorum_api_http_get (mixed $url, [mixed $method = NULL], string $url , string $method )

- string $url : The URL to retrieve.
- string $method : The method to use for retrieving the data. By default, this function will try to autodetect a working method. Providing a $method parameter is mostly useful for debugging purposes. Available methods (in the order in which they are probed in the code) are:
  - curl: using the curl library (requires extension "curl")
  - socket: using PHP socket programming (requires extension "sockets")
  - file: using fopen() (requires option "allow_url_fopen" to be enabled)

phorum_api_http_get_analyze (line 399)

A helper function for phorum_api_http_get() to determine what to do with a no "200 OK" response from the web server.

- return: The return array either contains the fields "error" and "fatal" (if there was some error) or the field "redirect" (if a new URL has to be requested).

array phorum_api_http_get_analyze (string $requested_url, string $code, mixed $header, string $header )

- string $requested_url
- string $code
- string $header

Documentation generated on Mon, 07 Jan 2008 01:45:43 -0600 by phpDocumentor 1.3.0RC5