Examples of BytesContentProvider


Examples of org.eclipse.jetty.client.util.BytesContentProvider

            }
        });

        ContentResponse response = client.POST(scheme + "://localhost:" + connector.getLocalPort() + "/?b=1")
                .param(paramName, paramValue)
                .content(new BytesContentProvider(content))
                .timeout(5, TimeUnit.SECONDS)
                .send();

        Assert.assertNotNull(response);
        Assert.assertEquals(200, response.getStatus());
View Full Code Here

Examples of org.eclipse.jetty.client.util.BytesContentProvider

                        buffer.get(bytes);
                        if (!Arrays.equals(content, bytes))
                            request.abort(new Exception());
                    }
                })
                .content(new BytesContentProvider(content))
                .timeout(5, TimeUnit.SECONDS)
                .send();

        Assert.assertNotNull(response);
        Assert.assertEquals(200, response.getStatus());
View Full Code Here

Examples of org.eclipse.jetty.client.util.BytesContentProvider

                        Assert.assertEquals(1, bytes.length);
                        buffer.get(bytes);
                        Assert.assertEquals(bytes[0], progress.getAndIncrement());
                    }
                })
                .content(new BytesContentProvider(new byte[]{0}, new byte[]{1}, new byte[]{2}, new byte[]{3}, new byte[]{4}))
                .timeout(5, TimeUnit.SECONDS)
                .send();

        Assert.assertNotNull(response);
        Assert.assertEquals(200, response.getStatus());
View Full Code Here

Examples of org.eclipse.jetty.client.util.BytesContentProvider

        try {
            clientRequest.writeEntity();
        } catch (final IOException e) {
            throw new ProcessingException("Failed to write request entity.", e);
        }
        return new BytesContentProvider(outputStream.toByteArray());
    }
View Full Code Here

Examples of org.eclipse.jetty.client.util.BytesContentProvider

                .method(request.getHttpMethod().method());


        byte[] entity = request.getEntity();
        if(entity != null){
            httpRequest = httpRequest.content(new BytesContentProvider(entity),request.getContentType());
        }

        Joiner joiner = Joiner.on(",").skipNulls();

        Map<String, Collection<String>> headers = request.getHeaders();
View Full Code Here

Examples of org.eclipse.jetty.client.util.BytesContentProvider

        BodyGenerator bodyGenerator = finalRequest.getBodyGenerator();
        if (bodyGenerator != null) {
            if (bodyGenerator instanceof StaticBodyGenerator) {
                StaticBodyGenerator staticBodyGenerator = (StaticBodyGenerator) bodyGenerator;
                jettyRequest.content(new BytesContentProvider(staticBodyGenerator.getBody()));
            }
            else {
                jettyRequest.content(new BodyGeneratorContentProvider(bodyGenerator, httpClient.getExecutor()));
            }
        }
View Full Code Here

Examples of org.eclipse.jetty.client.util.BytesContentProvider

        BodyGenerator bodyGenerator = finalRequest.getBodyGenerator();
        if (bodyGenerator != null) {
            if (bodyGenerator instanceof StaticBodyGenerator) {
                StaticBodyGenerator staticBodyGenerator = (StaticBodyGenerator) bodyGenerator;
                jettyRequest.content(new BytesContentProvider(staticBodyGenerator.getBody()));
            }
            else {
                jettyRequest.content(new BodyGeneratorContentProvider(bodyGenerator, httpClient.getExecutor()));
            }
        }
View Full Code Here

Examples of org.eclipse.jetty.client.util.BytesContentProvider

                .method(request.getHttpMethod().method());


        byte[] entity = request.getEntity();
        if(entity != null){
            httpRequest = httpRequest.content(new BytesContentProvider(entity),request.getContentType());
        }

        Joiner joiner = Joiner.on(",").skipNulls();

        Map<String, Collection<String>> headers = request.getHeaders();
View Full Code Here

Examples of org.eclipse.jetty.client.util.BytesContentProvider

        BodyGenerator bodyGenerator = finalRequest.getBodyGenerator();
        if (bodyGenerator != null) {
            if (bodyGenerator instanceof StaticBodyGenerator) {
                StaticBodyGenerator staticBodyGenerator = (StaticBodyGenerator) bodyGenerator;
                jettyRequest.content(new BytesContentProvider(staticBodyGenerator.getBody()));
            }
            else {
                jettyRequest.content(new BodyGeneratorContentProvider(bodyGenerator, httpClient.getExecutor()));
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.