src/JSONClient.php
public function requestAsync($method, $url, $body = [], $query = [], $headers = [])
    {
        if (!empty($body)) {
            $body = encode($body);
            $headers['Content-Type'] = 'application/json';
        } else {
            $body = null;
        }

        $headers = array_merge($this->global_headers, $headers);

        return $this->client->requestAsync($method, $url, [
            'query'   => $query,
            'body'    => $body,
            'headers' => $headers,
        ]);
    }
public function requestAsync($method, $url, $body = [], $query = [], $headers = [])
    {
        if (!empty($body)) {
            $body = encode($body);
            $headers['Content-Type'] = 'application/json';
        } else {
            $body = null;
        }

        $headers = array_merge($this->global_headers, $headers);

        return $this->client->requestAsync($method, $url, [
            'query'   => $query,
            'body'    => $body,
            'headers' => $headers,
        ]);
    }
public function requestAsync ( $ method , $ url , $ body = [ ] , $ query = [ ] , $ headers = [ ] ) { if ( ! empty ( $ body ) ) { $ body = encode ( $ body ) ; $ headers [ 'Content-Type' ] = 'application/json' ; } else { $ body = null ; } $ headers = array_merge ( $ this -> global_headers , $ headers ) ; return $ this -> client -> requestAsync ( $ method , $ url , [ 'query' => $ query , 'body' => $ body , 'headers' => $ headers , ] ) ; }
Return a promise for async requests.

@param string $method
@param string $url
@param array  $body
@param array  $query
@param array  $headers

@return \GuzzleHttp\Promise\PromiseInterface
Return a promise for async requests .