setUrl( $url, $getParameters ); return $this->send( $curl, $isJson ); } public function post($url, $getParameters = array(), $postParameters, $isJson = false) { $curl = new Curl(); $curl->setUrl( $url, $getParameters ); $curl->setMethod( true ); if( $isJson ) { $postParameters = json_encode($postParameters); $curl->addOption( 'HTTP_HEADER', array('Content-Type: application/json') ); } $curl->setPostParameters( $postParameters ); return $this->send( $curl, $isJson ); } protected function send($curl, $isJson) { $response = $curl->send(); if( $isJson ) { $response = json_decode($response); } return $response; } }