Skip to content

Commit

Permalink
Fixes re-use the PublisherAPI object issue
Browse files Browse the repository at this point in the history
  • Loading branch information
omitech authored Feb 1, 2022
1 parent 248d3cf commit d4ac9b0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/PublisherAPI/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
[
Expand All @@ -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(
[
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -218,8 +221,8 @@ public function post($path, Array $path_args, Array $data = []) {
$info['contents']
);
}

if (!empty($multiparts)) {
if (!empty($multiparts)) {
// Set content type and boundary token.
$content_type = sprintf('multipart/form-data; boundary=%s', $this->boundary);

Expand Down

0 comments on commit d4ac9b0

Please sign in to comment.