Zhamao Framework 3.2.4
A high-performance chatbot + web framework
载入中...
搜索中...
未找到
ZMRequest类 参考

静态 Public 成员函数

static get (string|UriInterface|\Stringable $url, array $headers=[], array $config=[], bool $only_body=true)
 
static post (string|UriInterface|\Stringable $url, array $header, mixed $data, array $config=[], bool $only_body=true)
 

成员函数说明

◆ get()

static get ( string|UriInterface|\Stringable  $url,
array  $headers = [],
array  $config = [],
bool  $only_body = true 
)
static

快速发起一个 GET 请求

参数
string | \Stringable | UriInterface$url请求地址
array$headers请求头
array$config传入参数
bool$only_body是否只返回 Response 的 body 部分,默认为 True
返回
bool|ResponseInterface|string 返回 False 代表请求失败,返回 string 为仅 Body 的内容,返回 Response 接口对象表明是回包
函数调用图:

◆ post()

static post ( string|UriInterface|\Stringable  $url,
array  $header,
mixed  $data,
array  $config = [],
bool  $only_body = true 
)
static

快速发起一个 POST 请求

参数
string | \Stringable | UriInterface$url请求地址
array$header请求头
mixed$data请求数据,当传入了一个可以 Json 化的对象时,自动 json_encode,其他情况须传入可字符串化的变量
array$config传入参数
bool$only_body是否只返回 Response 的 body 部分,默认为 True
返回
bool|ResponseInterface|string 返回 False 代表请求失败,返回 string 为仅 Body 的内容,返回 Response 接口对象表明是回包

该类的文档由以下文件生成: