(PECL pecl_http >= 1.0.0)
http_request — Perform custom request
$method
, string $url
[, string $body
[, array $options
[, array &$info
]]] )Performs a custom HTTP request on the supplied url.
请查阅完整的 request 选项组 列表。
成功时用字符串返回 HTTP 响应,失败时返回 FALSE
。
Dan (2012-01-05 11:28:10)
You should specify the first argument (int $method) using one of the Predefined HTTP request method constants specified here:
http://www.php.net/manual/en/http.constants.php
For example:
<?php
http_request (HTTP_METH_PUT, 'www.example.com');
?>
halfcountplus at intergate dot com (2010-06-10 06:11:42)
method arg is a define, eg "POST"
You need to install pecl_http to use this.