Skip to content

Commit 5892fdb

Browse files
committed
manual merge of #125
1 parent 32d792d commit 5892fdb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/resources/android-java/apiInvoker.mustache

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,11 @@ public class ApiInvoker {
156156
}
157157
else if ("POST".equals(method)) {
158158
HttpPost post = new HttpPost(url);
159-
post.setHeader("Content-Type", contentType);
160-
post.setEntity(new StringEntity(serialize(body), "UTF-8"));
159+
160+
if (body != null) {
161+
post.setHeader("Content-Type", contentType);
162+
post.setEntity(new StringEntity(serialize(body), "UTF-8"));
163+
}
161164
for(String key : headers.keySet()) {
162165
post.setHeader(key, headers.get(key));
163166
}

0 commit comments

Comments
 (0)