Package org.asynchttpclient

Examples of org.asynchttpclient.BodyGenerator


    }

    @SuppressWarnings({ "unchecked" })
    public boolean doHandle(final FilterChainContext ctx, final Request request, final HttpRequestPacket requestPacket) throws IOException {

        final BodyGenerator generator = request.getBodyGenerator();
        final Body bodyLocal = generator.createBody();
        final long len = bodyLocal.getContentLength();
        if (len >= 0) {
            requestPacket.setContentLengthLong(len);
        } else {
            requestPacket.setChunked(true);
View Full Code Here


            msg = new BodyFileRegion((RandomAccessBody) body);

        } else {
            msg = new BodyChunkedInput(body);

            BodyGenerator bg = future.getRequest().getBodyGenerator();
            if (bg instanceof FeedableBodyGenerator) {
                FeedableBodyGenerator.class.cast(bg).setListener(new FeedListener() {
                    @Override
                    public void onContentAdded() {
                        channel.pipeline().get(ChunkedWriteHandler.class).resumeTransfer();
View Full Code Here

TOP

Related Classes of org.asynchttpclient.BodyGenerator

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.