From 8c27b1a810c99324de514e86b912a37f49f3a0c5 Mon Sep 17 00:00:00 2001 From: bearwebua Date: Mon, 22 May 2017 22:24:00 -0700 Subject: [PATCH] Issue 4 Unable to re-use the PublisherAPI object to do more than one request --- src/PublisherAPI/Curl.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PublisherAPI/Curl.php b/src/PublisherAPI/Curl.php index 70d9b3a..5864b5d 100644 --- a/src/PublisherAPI/Curl.php +++ b/src/PublisherAPI/Curl.php @@ -120,6 +120,7 @@ protected function response($response) { * @return object Preprocessed structured object. */ public function get($path, Array $path_args = [], Array $data = []) { + $this->setHTTPClient(); parent::get($path, $path_args, $data); $this->setHeaders( [ @@ -139,6 +140,7 @@ public function get($path, Array $path_args = [], Array $data = []) { * @return object Preprocessed structured object and returns 204 No Content on success, with no response body. */ public function delete($path, Array $path_args = [], Array $data = []) { + $this->setHTTPClient(); parent::delete($path, $path_args, $data); $this->setHeaders( [ @@ -167,6 +169,7 @@ public function delete($path, Array $path_args = [], Array $data = []) { * @return object Preprocessed structured object. */ public function post($path, Array $path_args, Array $data = []) { + $this->setHTTPClient(); parent::post($path, $path_args, $data); // JSON string to be posted to PublisherAPI instead of article.json file.