http_request

(PECL pecl_http >= 1.0.0)

http_requestPerform custom request

Descrição

string http_request ( int $method , string $url [, string $body [, array $options [, array &$info ]]] )

Performs a custom HTTP request on the supplied url.

A lista completa de opções de request.

Parâmetros

method

Request method

url

URL

body

Request body

options

opções de request

info

informações sobre request/response

Valor Retornado

Returns the HTTP response(s) as string on success, or FALSE on failure.

add a note add a note

User Contributed Notes 1 note

up
-10
Dan
12 years ago
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');
?>
To Top