protected function httpDelete($uri)
    {
        $this->log[] = [
                        'request' => [
                                    'method' => 'DELETE',
                                    'uri'    => $uri,
                                    ],
                        ];
        $response = \Httpful\Request::delete($uri)
                                                ->addHeader('X-Auth-Email', $this->email)
                                                ->addHeader('X-Auth-Key', $this->apikey)
                                                ->expects(\Httpful\Mime::JSON)
                                                ->parseWith(function ($body) {
                                                    return \Metaclassing\Utility::decodeJson($body);
                                                })
                                                ->send()
                                                ->body;
        $this->log[count($this->log) - 1]['response'] = $response;
        if ($response['success'] != true) {
            throw new \Exception("delete to {$uri} unsuccessful");
        }

        return $response['result'];
    }
protected function httpDelete($uri)
    {
        $this->log[] = [
                        'request' => [
                                    'method' => 'DELETE',
                                    'uri'    => $uri,
                                    ],
                        ];
        $response = \Httpful\Request::delete($uri)
                                                ->addHeader('X-Auth-Email', $this->email)
                                                ->addHeader('X-Auth-Key', $this->apikey)
                                                ->expects(\Httpful\Mime::JSON)
                                                ->parseWith(function ($body) {
                                                    return \Metaclassing\Utility::decodeJson($body);
                                                })
                                                ->send()
                                                ->body;
        $this->log[count($this->log) - 1]['response'] = $response;
        if ($response['success'] != true) {
            throw new \Exception("delete to {$uri} unsuccessful");
        }

        return $response['result'];
    }
protected function httpDelete ( $ uri ) { $ this -> log [ ] = [ 'request' => [ 'method' => 'DELETE' , 'uri' => $ uri , ] , ] ; $ response = \ Httpful \ Request :: delete ( $ uri ) -> addHeader ( 'X-Auth-Email' , $ this -> email ) -> addHeader ( 'X-Auth-Key' , $ this -> apikey ) -> expects ( \ Httpful \ Mime :: JSON ) -> parseWith ( function ( $ body ) { return \ Metaclassing \ Utility :: decodeJson ( $ body ) ; } ) -> send ( ) -> body ; $ this -> log [ count ( $ this -> log ) - 1 ] [ 'response' ] = $ response ; if ( $ response [ 'success' ] != true ) { throw new \ Exception ( "delete to {$uri} unsuccessful" ) ; } return $ response [ 'result' ] ; }
Internal function to delete records in the API
Internal function to delete records in the API