/** * Tries to predict request content-length based on the {@link Request}. * Not all the <tt>PayloadGenerator</tt>s can predict the content-length in * advance. * * @param request * @return the content-length, or <tt>-1</tt> if the content-length * can't be predicted */ protected long getContentLength(final Request request) { return request.getContentLength(); }
@Override protected long getContentLength(final Request request) { return request.getContentLength() >= 0 ? request.getContentLength() : request.getFile().length(); } } // END FilePayloadGenerator
@Override protected long getContentLength(final Request request) { return request.getContentLength() >= 0 ? request.getContentLength() : request.getByteData().length; } }
int lenght = (int) request.getContentLength(); if (lenght != -1) { urlConnection.setRequestProperty("Content-Length", String.valueOf(lenght)); int length = (int) body.getContentLength(); if (length < 0) { length = (int) request.getContentLength();
/** * Tries to predict request content-length based on the {@link Request}. * Not all the <tt>PayloadGenerator</tt>s can predict the content-length in * advance. * * @param request * @return the content-length, or <tt>-1</tt> if the content-length * can't be predicted */ protected long getContentLength(final Request request) { return request.getContentLength(); }
/** * Tries to predict request content-length based on the {@link Request}. * Not all the <tt>PayloadGenerator</tt>s can predict the content-length in * advance. * * @param request * @return the content-length, or <tt>-1</tt> if the content-length * can't be predicted */ protected long getContentLength(final Request request) { return request.getContentLength(); }
/** * Tries to predict request content-length based on the {@link Request}. * Not all the <tt>BodyHandler</tt>s can predict the content-length in * advance. * * @param request * @return the content-length, or <tt>-1</tt> if the content-length * can't be predicted */ protected long getContentLength(final Request request) { return request.getContentLength(); } } // END BodyHandler
@Override public long getContentLength() { return delegate.getContentLength(); }
@Override protected long getContentLength(final Request request) { return request.getContentLength() >= 0 ? request.getContentLength() : request.getByteData().length; } }
@Override protected long getContentLength(final Request request) { return request.getContentLength() >= 0 ? request.getContentLength() : request.getByteData().length; } }
public RequestImpl(Request prototype) { if (prototype != null) { this.method = prototype.getMethod(); this.uri = prototype.getUri(); this.address = prototype.getInetAddress(); this.localAddress = prototype.getLocalAddress(); this.headers = new FluentCaseInsensitiveStringsMap(prototype.getHeaders()); this.cookies = new ArrayList<>(prototype.getCookies()); this.byteData = prototype.getByteData(); this.compositeByteData = prototype.getCompositeByteData(); this.stringData = prototype.getStringData(); this.streamData = prototype.getStreamData(); this.bodyGenerator = prototype.getBodyGenerator(); this.formParams = prototype.getFormParams() == null ? null : new ArrayList<>(prototype.getFormParams()); this.parts = prototype.getParts() == null ? null : new ArrayList<>(prototype.getParts()); this.virtualHost = prototype.getVirtualHost(); this.length = prototype.getContentLength(); this.proxyServer = prototype.getProxyServer(); this.realm = prototype.getRealm(); this.file = prototype.getFile(); this.followRedirects = prototype.getFollowRedirect(); this.requestTimeout = prototype.getRequestTimeout(); this.rangeOffset = prototype.getRangeOffset(); this.charset = prototype.getBodyEncoding(); this.connectionPoolPartitioning = prototype.getConnectionPoolPartitioning(); this.nameResolver = prototype.getNameResolver(); } }
@Override protected long getContentLength(final Request request) { return request.getContentLength() >= 0 ? request.getContentLength() : request.getFile().length(); } } // END FilePayloadGenerator
@Override protected long getContentLength(final Request request) { return request.getContentLength() >= 0 ? request.getContentLength() : request.getFile().length(); } } // END FilePayloadGenerator
@Override protected long getContentLength(final Request request) { if (request.getContentLength() >= 0) { return request.getContentLength(); } return clientConfig.isCompressionEnabled() ? -1 : request.getByteData().length; } }
@Override protected long getContentLength(final Request request) { if (request.getContentLength() >= 0) { return request.getContentLength(); } return clientConfig.isCompressionEnabled() ? -1 : request.getFile().length(); } } // END FileBodyHandler
private final static int computeAndSetContentLength(Request request, HttpMethodBase m) { int lenght = (int) request.getContentLength(); if (lenght == -1 && m.getRequestHeader("Content-Length") != null) { lenght = Integer.valueOf(m.getRequestHeader("Content-Length").getValue()); } if (lenght != -1) { m.setRequestHeader("Content-Length", String.valueOf(lenght)); } return lenght; }
final long contentLength = ahcRequest.getContentLength(); if (contentLength >= 0) { builder.contentLength(contentLength)
public RequestImpl(Request prototype) { if (prototype != null) { this.method = prototype.getMethod(); this.uri = prototype.getURI(); this.address = prototype.getInetAddress(); this.localAddress = prototype.getLocalAddress(); this.headers = new FluentCaseInsensitiveStringsMap(prototype.getHeaders()); this.cookies = new ArrayList<Cookie>(prototype.getCookies()); this.byteData = prototype.getByteData(); this.stringData = prototype.getStringData(); this.streamData = prototype.getStreamData(); this.bodyGenerator = prototype.getBodyGenerator(); this.formParams = prototype.getFormParams() == null ? null : new ArrayList<Param>(prototype.getFormParams()); this.parts = prototype.getParts() == null ? null : new ArrayList<Part>(prototype.getParts()); this.virtualHost = prototype.getVirtualHost(); this.length = prototype.getContentLength(); this.proxyServer = prototype.getProxyServer(); this.realm = prototype.getRealm(); this.file = prototype.getFile(); this.followRedirects = prototype.getFollowRedirect(); this.requestTimeout = prototype.getRequestTimeout(); this.rangeOffset = prototype.getRangeOffset(); this.charset = prototype.getBodyEncoding(); this.connectionPoolKeyStrategy = prototype.getConnectionPoolKeyStrategy(); } }
public RequestImpl(Request prototype) { if (prototype != null) { this.method = prototype.getMethod(); this.uri = prototype.getUri(); this.address = prototype.getInetAddress(); this.localAddress = prototype.getLocalAddress(); this.headers = new FluentCaseInsensitiveStringsMap(prototype.getHeaders()); this.cookies = new ArrayList<>(prototype.getCookies()); this.byteData = prototype.getByteData(); this.compositeByteData = prototype.getCompositeByteData(); this.stringData = prototype.getStringData(); this.streamData = prototype.getStreamData(); this.bodyGenerator = prototype.getBodyGenerator(); this.formParams = prototype.getFormParams() == null ? null : new ArrayList<>(prototype.getFormParams()); this.parts = prototype.getParts() == null ? null : new ArrayList<>(prototype.getParts()); this.virtualHost = prototype.getVirtualHost(); this.length = prototype.getContentLength(); this.proxyServer = prototype.getProxyServer(); this.realm = prototype.getRealm(); this.file = prototype.getFile(); this.followRedirects = prototype.getFollowRedirect(); this.requestTimeout = prototype.getRequestTimeout(); this.rangeOffset = prototype.getRangeOffset(); this.charset = prototype.getBodyEncoding(); this.connectionPoolPartitioning = prototype.getConnectionPoolPartitioning(); this.nameResolver = prototype.getNameResolver(); } }
public RequestImpl(Request prototype) { if (prototype != null) { this.method = prototype.getMethod(); this.uri = prototype.getUri(); this.address = prototype.getInetAddress(); this.localAddress = prototype.getLocalAddress(); this.headers = new FluentCaseInsensitiveStringsMap(prototype.getHeaders()); this.cookies = new ArrayList<>(prototype.getCookies()); this.byteData = prototype.getByteData(); this.compositeByteData = prototype.getCompositeByteData(); this.stringData = prototype.getStringData(); this.streamData = prototype.getStreamData(); this.bodyGenerator = prototype.getBodyGenerator(); this.formParams = prototype.getFormParams() == null ? null : new ArrayList<>(prototype.getFormParams()); this.parts = prototype.getParts() == null ? null : new ArrayList<>(prototype.getParts()); this.virtualHost = prototype.getVirtualHost(); this.length = prototype.getContentLength(); this.proxyServer = prototype.getProxyServer(); this.realm = prototype.getRealm(); this.file = prototype.getFile(); this.followRedirects = prototype.getFollowRedirect(); this.requestTimeout = prototype.getRequestTimeout(); this.rangeOffset = prototype.getRangeOffset(); this.charset = prototype.getBodyEncoding(); this.connectionPoolPartitioning = prototype.getConnectionPoolPartitioning(); this.nameResolver = prototype.getNameResolver(); } }