From 941f6e7757bc0693e5357647e409d3f844fbf7ec Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 10 Mar 2015 18:13:55 +0800 Subject: [PATCH] add PATCH support to PHP API client --- .../swagger-codegen/src/main/resources/php/Swagger.mustache | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/swagger-codegen/src/main/resources/php/Swagger.mustache b/modules/swagger-codegen/src/main/resources/php/Swagger.mustache index a7a18866345..d797bb53e9e 100644 --- a/modules/swagger-codegen/src/main/resources/php/Swagger.mustache +++ b/modules/swagger-codegen/src/main/resources/php/Swagger.mustache @@ -107,6 +107,9 @@ class APIClient { if ($method == self::$POST) { curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); + } else if ($method == self::$PATCH) { + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH"); + curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); } else if ($method == self::$PUT) { curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT"); curl_setopt($curl, CURLOPT_POSTFIELDS, $postData);