Requests_Session::request()

最后更新于:2021-11-26 04:04:42

Requests_Session::request( string$url, array$headers=array(), array|null$data=array(), string$type=Requests::GET, array$options=array())

Main interface for HTTP requests

参数

$url

(string) (Required) URL to request

$headers

(array) (Optional) Extra headers to send with the request

Default value: array()

$data

(array|null) (Optional) Data to send either as a query string for GET/HEAD requests, or in the body for POST requests

Default value: array()

$type

(string) (Optional) HTTP request type (use Requests constants)

Default value: Requests::GET

$options

(array) (Optional) Options for the request (see Requests::request)

Default value: array()

响应

(Requests_Response)

源文件

文件: gc-includes/Requests/Session.php

	public function request($url, $headers = array(), $data = array(), $type = Requests::GET, $options = array()) {
		$request = $this->merge_request(compact('url', 'headers', 'data', 'options'));

		return Requests::request($request['url'], $request['headers'], $request['data'], $type, $request['options']);
	}