src/ManagementClient.php
function post($resource, $payload = array(), $headers = array())
    {
        $result = $this->client->post($this->build_url($resource), [
            'headers' => array_merge([
                'Content-Type' => $this->getContentType(),
                'Authorization' => $this->getBearer(),
                'Content-Length' => (!count($payload)) ? 0 : strlen(json_encode($payload)),
            ], $headers),
            'body' => json_encode($payload)
        ]);
        return $result;
    }
function post($resource, $payload = array(), $headers = array())
    {
        $result = $this->client->post($this->build_url($resource), [
            'headers' => array_merge([
                'Content-Type' => $this->getContentType(),
                'Authorization' => $this->getBearer(),
                'Content-Length' => (!count($payload)) ? 0 : strlen(json_encode($payload)),
            ], $headers),
            'body' => json_encode($payload)
        ]);
        return $result;
    }
function post ( $ resource , $ payload = array ( ) , $ headers = array ( ) ) { $ result = $ this -> client -> post ( $ this -> build_url ( $ resource ) , [ 'headers' => array_merge ( [ 'Content-Type' => $ this -> getContentType ( ) , 'Authorization' => $ this -> getBearer ( ) , 'Content-Length' => ( ! count ( $ payload ) ) ? 0 : strlen ( json_encode ( $ payload ) ) , ] , $ headers ) , 'body' => json_encode ( $ payload ) ] ) ; return $ result ; }
Build and make a POST request.
@param $resource
@param array $payload
@param array $headers
@return GuzzleHttp\Message\FutureResponse|GuzzleHttp\Message\ResponseInterface|GuzzleHttp\Ring\Future\FutureInterface|mixed|null
Build and make a POST request .