PHP Velho Oeste 2024

http_request

(PECL pecl_http >= 1.0.0)

http_requestPerform custom request

설명

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

Performs a custom HTTP request on the supplied url.

요청 옵션들의 전체 목록을 참고하십시오.

인수

method

Request method

url

URL

body

Request body

options

요청 옵션들

info

요청/응답 정보

반환값

성공시 HTTP 응답을 문자열로, 실패시 FALSE를 반환합니다.

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