protected function postRequest()
    {
        $response = $this->client->post($this->buildUrl(),
            [
                'auth'    => $this->getAuth(),
                'json'    => $this->getBody(),
                'headers' => [
                    'Accept' => 'application/json',
                ],
            ]);

        if ($response->getStatusCode() != 201 && $response->getStatusCode() != 200) {
            throw new \Exception('Unable to request from API. HTTP Error: '.$response->getStatusCode());
        }

        return $response;
    }
protected function postRequest()
    {
        $response = $this->client->post($this->buildUrl(),
            [
                'auth'    => $this->getAuth(),
                'json'    => $this->getBody(),
                'headers' => [
                    'Accept' => 'application/json',
                ],
            ]);

        if ($response->getStatusCode() != 201 && $response->getStatusCode() != 200) {
            throw new \Exception('Unable to request from API. HTTP Error: '.$response->getStatusCode());
        }

        return $response;
    }
protected function postRequest ( ) { $ response = $ this -> client -> post ( $ this -> buildUrl ( ) , [ 'auth' => $ this -> getAuth ( ) , 'json' => $ this -> getBody ( ) , 'headers' => [ 'Accept' => 'application/json' , ] , ] ) ; if ( $ response -> getStatusCode ( ) != 201 && $ response -> getStatusCode ( ) != 200 ) { throw new \ Exception ( 'Unable to request from API. HTTP Error: ' . $ response -> getStatusCode ( ) ) ; } return $ response ; }
Creates and sends a POST request to the requested URL.

@throws \Exception

@return mixed
Creates and sends a POST request to the requested URL .