Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

RequestBuilder api usage update

  • Loading branch information...
commit 720b97baf2f68bd60cee09694cad330c47742129 1 parent 89e3843
@neotyk authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/jvm/ahc/RequestBuilderWrapper.java
View
5 src/jvm/ahc/RequestBuilderWrapper.java
@@ -1,4 +1,5 @@
package ahc;
+
import java.io.File;
import java.io.InputStream;
import com.ning.http.client.Realm;
@@ -6,6 +7,8 @@
import com.ning.http.client.PerRequestConfig;
import com.ning.http.client.ProxyServer;
import com.ning.http.client.Cookie;
+import com.ning.http.client.generators.InputStreamBodyGenerator;
+
public class RequestBuilderWrapper {
private RequestBuilder rb;
public RequestBuilderWrapper(RequestBuilder rb) { this.rb = rb; }
@@ -25,7 +28,7 @@ public RequestBuilderWrapper setBody(byte[] data) {
rb.setBody(data);
return this;}
public RequestBuilderWrapper setBody(InputStream stream) {
- rb.setBody(stream);
+ rb.setBody(new InputStreamBodyGenerator(stream));
return this;}
public RequestBuilderWrapper setBody(File f) {
rb.setBody(f);
Please sign in to comment.
Something went wrong with that request. Please try again.