Lndj\Traits\BuildRequest::buildPostRequest PHP Method

buildPostRequest() public method

Build the POST request.
public buildPostRequest ( $uri, $query, $param, array $headers = [], boolean $isAsync = false ) : mixed
$uri
$query
$param
$headers array A array of headers.
$isAsync boolean If use getAll(), by Async request.
return mixed
    public function buildPostRequest($uri, $query, $param, $headers = [], $isAsync = false)
    {
        $query_param = array_merge(['xh' => $this->stu_id], $query);
        $post = ['query' => $query_param, 'headers' => $headers, 'form_params' => $param];
        //If opened cookie cache
        if ($this->cacheCookie) {
            $post['cookies'] = $this->getCookie();
        }
        //If use getAll(), use the Async request.
        return $isAsync ? $this->client->postAsync($uri, $post) : $this->client->post($uri, $post);
    }