We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32d792d commit 5892fdbCopy full SHA for 5892fdb
src/main/resources/android-java/apiInvoker.mustache
@@ -156,8 +156,11 @@ public class ApiInvoker {
156
}
157
else if ("POST".equals(method)) {
158
HttpPost post = new HttpPost(url);
159
- post.setHeader("Content-Type", contentType);
160
- post.setEntity(new StringEntity(serialize(body), "UTF-8"));
+
+ if (body != null) {
161
+ post.setHeader("Content-Type", contentType);
162
+ post.setEntity(new StringEntity(serialize(body), "UTF-8"));
163
+ }
164
for(String key : headers.keySet()) {
165
post.setHeader(key, headers.get(key));
166
0 commit comments