Package org.asynchttpclient.multipart

Examples of org.asynchttpclient.multipart.StringPart


    public void asyncDoPostMultiPartTest() throws Exception {
        AsyncHttpClient client = getAsyncHttpClient(null);
        try {
            final CountDownLatch l = new CountDownLatch(1);

            Part p = new StringPart("foo", "bar");

            client.preparePost(getTargetUrl()).addBodyPart(p).execute(new AsyncCompletionHandlerAdapter() {

                @Override
                public Response onCompleted(Response response) throws Exception {
View Full Code Here


            RequestBuilder builder = new RequestBuilder("POST");
            builder.setUrl("http://localhost" + ":" + port1 + "/upload/bob");
            builder.addBodyPart(new FilePart("file1", testResource1File, "text/plain", UTF_8));
            builder.addBodyPart(new FilePart("file2", testResource2File, "application/x-gzip", null));
            builder.addBodyPart(new StringPart("Name", "Dominic"));
            builder.addBodyPart(new FilePart("file3", testResource3File, "text/plain", UTF_8));

            builder.addBodyPart(new StringPart("Age", "3"));
            builder.addBodyPart(new StringPart("Height", "shrimplike"));
            builder.addBodyPart(new StringPart("Hair", "ridiculous"));

            builder.addBodyPart(new ByteArrayPart("file4", expectedContents.getBytes(UTF_8), "text/plain", UTF_8, "bytearray.txt"));

            Request r = builder.build();
View Full Code Here

TOP

Related Classes of org.asynchttpclient.multipart.StringPart

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.