Skip to content

Commit

Permalink
Merge pull request square#92 from square/jw/synchronous-post
Browse files Browse the repository at this point in the history
Only exclude the last param if execution is not synchronous.
  • Loading branch information
pforhan committed Oct 30, 2012
2 parents fba17d4 + bfeaea1 commit 6de6206
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion retrofit/src/main/java/retrofit/http/HttpMethodType.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ private static void addParams(HttpEntityEnclosingRequestBase request, HttpReques
Class<?>[] parameterTypes = method.getParameterTypes();

Annotation[][] parameterAnnotations = method.getParameterAnnotations();
int count = parameterAnnotations.length - 1;
int count = parameterAnnotations.length;
if (!builder.isSynchronous()) {
count -= 1;
}

if (useMultipart(parameterTypes, parameterAnnotations)) {
MultipartEntity form = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
Expand Down
4 changes: 4 additions & 0 deletions retrofit/src/main/java/retrofit/http/HttpRequestBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ Method getMethod() {
return javaMethod;
}

boolean isSynchronous() {
return isSynchronous;
}

String getRelativePath() {
return replacedRelativePath != null ? replacedRelativePath : requestLine.getRelativePath();
}
Expand Down

0 comments on commit 6de6206

Please sign in to comment.