public <T> void post(TypeReference<T> typeReference, ResultCallback<T> resultCallback, InputStream body) { HttpRequestProvider requestProvider = httpPostRequestProvider(null); Channel channel = getChannel(); JsonResponseCallbackHandler<T> jsonResponseHandler = new JsonResponseCallbackHandler<T>(typeReference, resultCallback); HttpResponseHandler responseHandler = new HttpResponseHandler(requestProvider, resultCallback); channel.pipeline().addLast(new ChunkedWriteHandler()); channel.pipeline().addLast(responseHandler); channel.pipeline().addLast(new JsonObjectDecoder()); channel.pipeline().addLast(jsonResponseHandler); postChunkedStreamRequest(requestProvider, channel, body); }
public <T> void post(final Object entity, TypeReference<T> typeReference, final ResultCallback<T> resultCallback) { HttpRequestProvider requestProvider = httpPostRequestProvider(entity); Channel channel = getChannel(); JsonResponseCallbackHandler<T> jsonResponseHandler = new JsonResponseCallbackHandler<T>(typeReference, resultCallback); HttpResponseHandler responseHandler = new HttpResponseHandler(requestProvider, resultCallback); channel.pipeline().addLast(responseHandler); channel.pipeline().addLast(new JsonObjectDecoder()); channel.pipeline().addLast(jsonResponseHandler); sendRequest(requestProvider, channel); return; }
public InputStream post(final Object entity) { HttpRequestProvider requestProvider = httpPostRequestProvider(entity); Channel channel = getChannel(); AsyncResultCallback<InputStream> callback = new AsyncResultCallback<>(); HttpResponseHandler responseHandler = new HttpResponseHandler(requestProvider, callback); HttpResponseStreamHandler streamHandler = new HttpResponseStreamHandler(callback); channel.pipeline().addLast(responseHandler); channel.pipeline().addLast(streamHandler); sendRequest(requestProvider, channel); return callback.awaitResult(); }
public void postStream(InputStream body) { SkipResultCallback resultCallback = new SkipResultCallback(); HttpRequestProvider requestProvider = httpPostRequestProvider(null); Channel channel = getChannel(); HttpResponseHandler responseHandler = new HttpResponseHandler(requestProvider, resultCallback); channel.pipeline().addLast(new ChunkedWriteHandler()); channel.pipeline().addLast(responseHandler); postChunkedStreamRequest(requestProvider, channel, body); try { resultCallback.awaitCompletion(); } catch (InterruptedException e) { throw new RuntimeException(e); } }
public void post(final Object entity, final InputStream stdin, final ResultCallback<Frame> resultCallback) { HttpRequestProvider requestProvider = httpPostRequestProvider(entity);
public <T> void post(TypeReference<T> typeReference, ResultCallback<T> resultCallback, InputStream body) { HttpRequestProvider requestProvider = httpPostRequestProvider(null); Channel channel = getChannel(); JsonResponseCallbackHandler<T> jsonResponseHandler = new JsonResponseCallbackHandler<T>(typeReference, resultCallback); HttpResponseHandler responseHandler = new HttpResponseHandler(requestProvider, resultCallback); channel.pipeline().addLast(new ChunkedWriteHandler()); channel.pipeline().addLast(responseHandler); channel.pipeline().addLast(new JsonObjectDecoder()); channel.pipeline().addLast(jsonResponseHandler); postChunkedStreamRequest(requestProvider, channel, body); }
public <T> void post(final Object entity, TypeReference<T> typeReference, final ResultCallback<T> resultCallback) { HttpRequestProvider requestProvider = httpPostRequestProvider(entity); Channel channel = getChannel(); JsonResponseCallbackHandler<T> jsonResponseHandler = new JsonResponseCallbackHandler<T>(typeReference, resultCallback); HttpResponseHandler responseHandler = new HttpResponseHandler(requestProvider, resultCallback); channel.pipeline().addLast(responseHandler); channel.pipeline().addLast(new JsonObjectDecoder()); channel.pipeline().addLast(jsonResponseHandler); sendRequest(requestProvider, channel); return; }
public void postStream(InputStream body) { SkipResultCallback resultCallback = new SkipResultCallback(); HttpRequestProvider requestProvider = httpPostRequestProvider(null); Channel channel = getChannel(); HttpResponseHandler responseHandler = new HttpResponseHandler(requestProvider, resultCallback); channel.pipeline().addLast(new ChunkedWriteHandler()); channel.pipeline().addLast(responseHandler); postChunkedStreamRequest(requestProvider, channel, body); try { resultCallback.awaitCompletion(); } catch (InterruptedException e) { throw new RuntimeException(e); } }
public InputStream post(final Object entity) { HttpRequestProvider requestProvider = httpPostRequestProvider(entity); Channel channel = getChannel(); AsyncResultCallback<InputStream> callback = new AsyncResultCallback<>(); HttpResponseHandler responseHandler = new HttpResponseHandler(requestProvider, callback); HttpResponseStreamHandler streamHandler = new HttpResponseStreamHandler(callback); channel.pipeline().addLast(responseHandler); channel.pipeline().addLast(streamHandler); sendRequest(requestProvider, channel); return callback.awaitResult(); }
public void post(final Object entity, final InputStream stdin, final ResultCallback<Frame> resultCallback) { HttpRequestProvider requestProvider = httpPostRequestProvider(entity);