MultipartForm: adding support for php

This commit is contained in:
James Ebentier 2015-02-04 11:49:28 -08:00
parent 6c97a9c6c7
commit 0f041dae90
2 changed files with 7 additions and 1 deletions

View File

@ -77,7 +77,8 @@ class APIClient {
$headers[] = "api_key: " . $this->apiKey;
}
if (is_object($postData) or is_array($postData)) {
if (strpos($headers['Content-Type'], "multipart/form-data") < 0 and (is_object($postData) or is_array($postData))) {
$postData = json_encode($this->sanitizeForSerialization($postData));
}

View File

@ -72,7 +72,12 @@ class {{classname}} {
}
{{#formParams}}
if(${{paramName}} != null) {
{{#notFile}}
$body['{{paramName}}'] = ${{paramName}};
{{/notFile}}
{{#isFile}}
$body['{{paramName}}'] = '@' . ${{paramName}};
{{/isFile}}
}
{{/formParams}}
if (empty($body)) {