diff --git a/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache index 3c6819ab73b..8927cbbecb3 100644 --- a/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache @@ -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);