Skip to content

Commit

Permalink
Merge pull request #2306 from Hotfirenet/alpha
Browse files Browse the repository at this point in the history
add patch method
  • Loading branch information
zoic21 committed Oct 4, 2023
2 parents b67cc76 + 31df728 commit 7f91eab
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion core/com/http.com.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class com_http {
private $sleepTime = 500000;
private $post = '';
private $put = '';
private $patch = '';
private $delete = '';
private $header = array('Connection: close');
private $cookiesession = false;
Expand Down Expand Up @@ -95,6 +96,10 @@ public function exec($_timeout = 2, $_maxRetry = 3) {
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->getPut());
}
if ($this->getPatch() != '') {
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->getPatch());
}
if ($this->getDelete() != '') {
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->getDelete());
Expand Down Expand Up @@ -248,6 +253,15 @@ public function setPut($put = array()) {
return $this;
}

public function getPatch() {
return $this->patch;
}

public function setPatch($patch = array()) {
$this->patch = $patch;
return $this;
}

public function getUserAgent() {
return $this->userAgent;
}
Expand Down Expand Up @@ -275,4 +289,4 @@ public function setCURLOPT($CURLOPT) {
return $this;
}

}
}

0 comments on commit 7f91eab

Please sign in to comment.