/** * Resets the underlying InputStream if this isn't the first attempt to * write out the request, otherwise simply delegates to * InputStreamRequestEntity to write out the data. * <p> * If an error is encountered the first time we try to write the request * entity, we remember the original exception, and report that as the root * cause if we continue to encounter errors, rather than masking the * original error. * * @see org.apache.commons.httpclient.methods.RequestEntity#writeRequest(java.io.OutputStream) */ @Override public void writeTo(OutputStream output) throws IOException { try { if (!firstAttempt && isRepeatable()) content.reset(); firstAttempt = false; inputStreamRequestEntity.writeTo(output); } catch (IOException ioe) { if (originalException == null) originalException = ioe; throw originalException; } }
setChunked(false); ServiceMetricType.UPLOAD_BYTE_COUNT_NAME_SUFFIX); content = getContent(request); inputStreamRequestEntity = (type == null) ? new InputStreamEntity(content, contentLength) : new MetricInputStreamEntity(type, content, contentLength); inputStreamRequestEntity.setContentType(contentType); setContent(content); setContentType(contentType); setContentLength(contentLength);
entityEnclosingRequest.setEntity(ApacheUtils.newStringEntity(encodedParams)); } else { entityEnclosingRequest.setEntity(new RepeatableInputStreamRequestEntity(request)); HttpEntity entity = new RepeatableInputStreamRequestEntity(request); if (request.getHeaders().get(HttpHeaders.CONTENT_LENGTH) == null) { entity = ApacheUtils.newBufferedHttpEntity(entity);
setChunked(false); ServiceMetricType.UPLOAD_BYTE_COUNT_NAME_SUFFIX); content = getContent(request); inputStreamRequestEntity = (type == null) ? new InputStreamEntity(content, contentLength) : new MetricInputStreamEntity(type, content, contentLength); inputStreamRequestEntity.setContentType(contentType); setContent(content); setContentType(contentType); setContentLength(contentLength);
/** * Resets the underlying InputStream if this isn't the first attempt to * write out the request, otherwise simply delegates to * InputStreamRequestEntity to write out the data. * <p> * If an error is encountered the first time we try to write the request * entity, we remember the original exception, and report that as the root * cause if we continue to encounter errors, rather than masking the * original error. * * @see org.apache.commons.httpclient.methods.RequestEntity#writeRequest(java.io.OutputStream) */ @Override public void writeTo(OutputStream output) throws IOException { try { if (!firstAttempt && isRepeatable()) content.reset(); firstAttempt = false; inputStreamRequestEntity.writeTo(output); } catch (IOException ioe) { if (originalException == null) originalException = ioe; throw originalException; } }
entityEnclosingRequest.setEntity(ApacheUtils.newStringEntity(encodedParams)); } else { entityEnclosingRequest.setEntity(new RepeatableInputStreamRequestEntity(request)); HttpEntity entity = new RepeatableInputStreamRequestEntity(request); if (request.getHeaders().get(HttpHeaders.CONTENT_LENGTH) == null) { entity = ApacheUtils.newBufferedHttpEntity(entity);
setChunked(false); content = request.getContent(); setContent(content); setContentType(contentType); setContentLength(contentLength);
/** * Resets the underlying InputStream if this isn't the first attempt to * write out the request, otherwise simply delegates to * InputStreamRequestEntity to write out the data. * <p> * If an error is encountered the first time we try to write the request * entity, we remember the original exception, and report that as the root * cause if we continue to encounter errors, rather than masking the * original error. * * @see org.apache.commons.httpclient.methods.RequestEntity#writeRequest(java.io.OutputStream) */ @Override public void writeTo(OutputStream output) throws IOException { try { if (!firstAttempt && isRepeatable()) content.reset(); firstAttempt = false; inputStreamRequestEntity.writeTo(output); } catch (IOException ioe) { if (originalException == null) originalException = ioe; throw originalException; } }
entityEnclosingRequest.setEntity(ApacheUtils.newStringEntity(encodedParams)); } else { entityEnclosingRequest.setEntity(new RepeatableInputStreamRequestEntity(request)); HttpEntity entity = new RepeatableInputStreamRequestEntity(request); if (request.getHeaders().get(HttpHeaders.CONTENT_LENGTH) == null) { entity = ApacheUtils.newBufferedHttpEntity(entity);
setChunked(false); ServiceMetricType.UPLOAD_BYTE_COUNT_NAME_SUFFIX); content = getContent(request); inputStreamRequestEntity = (type == null) ? new InputStreamEntity(content, contentLength) : new MetricInputStreamEntity(type, content, contentLength); inputStreamRequestEntity.setContentType(contentType); setContent(content); setContentType(contentType); setContentLength(contentLength);
/** * Resets the underlying InputStream if this isn't the first attempt to * write out the request, otherwise simply delegates to * InputStreamRequestEntity to write out the data. * <p> * If an error is encountered the first time we try to write the request * entity, we remember the original exception, and report that as the root * cause if we continue to encounter errors, rather than masking the * original error. * * @see org.apache.commons.httpclient.methods.RequestEntity#writeRequest(java.io.OutputStream) */ @Override public void writeTo(OutputStream output) throws IOException { try { if (!firstAttempt && isRepeatable()) content.reset(); firstAttempt = false; inputStreamRequestEntity.writeTo(output); } catch (IOException ioe) { if (originalException == null) originalException = ioe; throw originalException; } }
setChunked(false); content = request.getContent(); setContent(content); setContentType(contentType); setContentLength(contentLength);
/** * Resets the underlying InputStream if this isn't the first attempt to * write out the request, otherwise simply delegates to * InputStreamRequestEntity to write out the data. * <p> * If an error is encountered the first time we try to write the request * entity, we remember the original exception, and report that as the root * cause if we continue to encounter errors, rather than masking the * original error. * * @see org.apache.commons.httpclient.methods.RequestEntity#writeRequest(java.io.OutputStream) */ @Override public void writeTo(OutputStream output) throws IOException { try { if (!firstAttempt && isRepeatable()) content.reset(); firstAttempt = false; inputStreamRequestEntity.writeTo(output); } catch (IOException ioe) { if (originalException == null) originalException = ioe; throw originalException; } }
setChunked(false); content = request.getContent(); setContent(content); setContentType(contentType); setContentLength(contentLength);
/** * Resets the underlying InputStream if this isn't the first attempt to * write out the request, otherwise simply delegates to * InputStreamRequestEntity to write out the data. * <p> * If an error is encountered the first time we try to write the request * entity, we remember the original exception, and report that as the root * cause if we continue to encounter errors, rather than masking the * original error. * * @see org.apache.commons.httpclient.methods.RequestEntity#writeRequest(java.io.OutputStream) */ @Override public void writeTo(OutputStream output) throws IOException { try { if (!firstAttempt && isRepeatable()) content.reset(); firstAttempt = false; inputStreamRequestEntity.writeTo(output); } catch (IOException ioe) { if (originalException == null) originalException = ioe; throw originalException; } }