mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 19:33:55 +00:00
Merge pull request #1210 from arnested/missing-head-and-options-in-php-client
Add HEAD and OPTIONS support in PHP client.
This commit is contained in:
commit
b3db24ead6
@ -48,6 +48,8 @@ class ApiClient
|
||||
public static $PATCH = "PATCH";
|
||||
public static $POST = "POST";
|
||||
public static $GET = "GET";
|
||||
public static $HEAD = "HEAD";
|
||||
public static $OPTIONS = "OPTIONS";
|
||||
public static $PUT = "PUT";
|
||||
public static $DELETE = "DELETE";
|
||||
|
||||
@ -170,6 +172,11 @@ class ApiClient
|
||||
if ($method == self::$POST) {
|
||||
curl_setopt($curl, CURLOPT_POST, true);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $postData);
|
||||
} else if ($method == self::$HEAD) {
|
||||
curl_setopt($curl, CURLOPT_NOBODY, true);
|
||||
} else if ($method == self::$OPTIONS) {
|
||||
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "OPTIONS");
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $postData);
|
||||
} else if ($method == self::$PATCH) {
|
||||
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH");
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $postData);
|
||||
|
Loading…
Reference in New Issue
Block a user