Merge branch release/21.7.5 of zentao/zentaopms (#10955)
This commit is contained in:
@@ -77,6 +77,33 @@ class rest
|
||||
return $resp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Patch method.
|
||||
*
|
||||
* @param string $url
|
||||
* @param array $data
|
||||
* @param array $headers
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function patch($url, $data = array(), $headers = array())
|
||||
{
|
||||
$headers['Accept'] = 'application/json';
|
||||
$headers['Content-Type'] = 'application/json';
|
||||
$data = json_encode($data);
|
||||
|
||||
$resp = requests::patch($this->base . $url, $headers, $data, array());
|
||||
try
|
||||
{
|
||||
$resp->body = json_decode($resp->body);
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
}
|
||||
|
||||
return $resp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Put method.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user