/** * @return Returns the requestEntity. * * @since 3.0 */ public RequestEntity getRequestEntity() { return generateRequestEntity(); }
/** * Returns the length of the request body. * * @return number of bytes in the request body */ protected long getRequestContentLength() { LOG.trace("enter EntityEnclosingMethod.getRequestContentLength()"); if (!hasRequestContent()) { return 0; } if (this.chunked) { return -1; } if (this.requestEntity == null) { this.requestEntity = generateRequestEntity(); } return (this.requestEntity == null) ? 0 : this.requestEntity.getContentLength(); }
/** * Generates a request entity from the post parameters, if present. Calls * {@link EntityEnclosingMethod#generateRequestBody()} if parameters have not been set. * * @since 3.0 */ protected RequestEntity generateRequestEntity() { if (!this.params.isEmpty()) { // Use a ByteArrayRequestEntity instead of a StringRequestEntity. // This is to avoid potential encoding issues. Form url encoded strings // are ASCII by definition but the content type may not be. Treating the content // as bytes allows us to keep the current charset without worrying about how // this charset will effect the encoding of the form url encoded string. String content = EncodingUtil.formUrlEncode(getParameters(), getRequestCharSet()); ByteArrayRequestEntity entity = new ByteArrayRequestEntity( EncodingUtil.getAsciiBytes(content), FORM_URL_ENCODED_CONTENT_TYPE ); return entity; } else { return super.generateRequestEntity(); } }
this.requestEntity = generateRequestEntity();
/** * @return Returns the requestEntity. * * @since 3.0 */ public RequestEntity getRequestEntity() { return generateRequestEntity(); }
/** * @return Returns the requestEntity. * * @since 3.0 */ public RequestEntity getRequestEntity() { return generateRequestEntity(); }
/** * @return Returns the requestEntity. * * @since 3.0 */ public RequestEntity getRequestEntity() { return generateRequestEntity(); }
/** * @return Returns the requestEntity. * * @since 3.0 */ public RequestEntity getRequestEntity() { return generateRequestEntity(); }
/** * Returns the length of the request body. * * @return number of bytes in the request body */ protected long getRequestContentLength() { LOG.trace("enter EntityEnclosingMethod.getRequestContentLength()"); if (!hasRequestContent()) { return 0; } if (this.chunked) { return -1; } if (this.requestEntity == null) { this.requestEntity = generateRequestEntity(); } return (this.requestEntity == null) ? 0 : this.requestEntity.getContentLength(); }
/** * Returns the length of the request body. * * @return number of bytes in the request body */ protected long getRequestContentLength() { LOG.trace("enter EntityEnclosingMethod.getRequestContentLength()"); if (!hasRequestContent()) { return 0; } if (this.chunked) { return -1; } if (this.requestEntity == null) { this.requestEntity = generateRequestEntity(); } return (this.requestEntity == null) ? 0 : this.requestEntity.getContentLength(); }
/** * Returns the length of the request body. * * @return number of bytes in the request body */ protected long getRequestContentLength() { LOG.trace("enter EntityEnclosingMethod.getRequestContentLength()"); if (!hasRequestContent()) { return 0; } if (this.chunked) { return -1; } if (this.requestEntity == null) { this.requestEntity = generateRequestEntity(); } return (this.requestEntity == null) ? 0 : this.requestEntity.getContentLength(); }
/** * Returns the length of the request body. * * @return number of bytes in the request body */ protected long getRequestContentLength() { LOG.trace("enter EntityEnclosingMethod.getRequestContentLength()"); if (!hasRequestContent()) { return 0; } if (this.chunked) { return -1; } if (this.requestEntity == null) { this.requestEntity = generateRequestEntity(); } return (this.requestEntity == null) ? 0 : this.requestEntity.getContentLength(); }
/** * Generates a request entity from the post parameters, if present. Calls * {@link EntityEnclosingMethod#generateRequestBody()} if parameters have not been set. * * @since 3.0 */ @Override protected RequestEntity generateRequestEntity() { if (!this.params.isEmpty()) { // Use a ByteArrayRequestEntity instead of a StringRequestEntity. // This is to avoid potential encoding issues. Form url encoded strings // are ASCII by definition but the content type may not be. Treating the content // as bytes allows us to keep the current charset without worrying about how // this charset will effect the encoding of the form url encoded string. String content = EncodingUtil.formUrlEncode(getParameters(), getRequestCharSet()); ByteArrayRequestEntity entity = new ByteArrayRequestEntity( EncodingUtil.getAsciiBytes(content), FORM_URL_ENCODED_CONTENT_TYPE ); return entity; } return super.generateRequestEntity(); }
/** * Generates a request entity from the post parameters, if present. Calls * {@link EntityEnclosingMethod#generateRequestBody()} if parameters have not been set. * * @since 3.0 */ protected RequestEntity generateRequestEntity() { if (!this.params.isEmpty()) { // Use a ByteArrayRequestEntity instead of a StringRequestEntity. // This is to avoid potential encoding issues. Form url encoded strings // are ASCII by definition but the content type may not be. Treating the content // as bytes allows us to keep the current charset without worrying about how // this charset will effect the encoding of the form url encoded string. String content = EncodingUtil.formUrlEncode(getParameters(), getRequestCharSet()); ByteArrayRequestEntity entity = new ByteArrayRequestEntity( EncodingUtil.getAsciiBytes(content), FORM_URL_ENCODED_CONTENT_TYPE ); return entity; } else { return super.generateRequestEntity(); } }
/** * Generates a request entity from the post parameters, if present. Calls * {@link EntityEnclosingMethod#generateRequestBody()} if parameters have not been set. * * @since 3.0 */ protected RequestEntity generateRequestEntity() { if (!this.params.isEmpty()) { // Use a ByteArrayRequestEntity instead of a StringRequestEntity. // This is to avoid potential encoding issues. Form url encoded strings // are ASCII by definition but the content type may not be. Treating the content // as bytes allows us to keep the current charset without worrying about how // this charset will effect the encoding of the form url encoded string. String content = EncodingUtil.formUrlEncode(getParameters(), getRequestCharSet()); ByteArrayRequestEntity entity = new ByteArrayRequestEntity( EncodingUtil.getAsciiBytes(content), FORM_URL_ENCODED_CONTENT_TYPE ); return entity; } else { return super.generateRequestEntity(); } }
/** * Generates a request entity from the post parameters, if present. Calls * {@link EntityEnclosingMethod#generateRequestBody()} if parameters have not been set. * * @since 3.0 */ protected RequestEntity generateRequestEntity() { if (!this.params.isEmpty()) { // Use a ByteArrayRequestEntity instead of a StringRequestEntity. // This is to avoid potential encoding issues. Form url encoded strings // are ASCII by definition but the content type may not be. Treating the content // as bytes allows us to keep the current charset without worrying about how // this charset will effect the encoding of the form url encoded string. String content = EncodingUtil.formUrlEncode(getParameters(), getRequestCharSet()); ByteArrayRequestEntity entity = new ByteArrayRequestEntity( EncodingUtil.getAsciiBytes(content), FORM_URL_ENCODED_CONTENT_TYPE ); return entity; } else { return super.generateRequestEntity(); } }
/** * Generates a request entity from the post parameters, if present. Calls * {@link EntityEnclosingMethod#generateRequestBody()} if parameters have not been set. * * @since 3.0 */ protected RequestEntity generateRequestEntity() { if (!this.params.isEmpty()) { // Use a ByteArrayRequestEntity instead of a StringRequestEntity. // This is to avoid potential encoding issues. Form url encoded strings // are ASCII by definition but the content type may not be. Treating the content // as bytes allows us to keep the current charset without worrying about how // this charset will effect the encoding of the form url encoded string. String content = EncodingUtil.formUrlEncode(getParameters(), getRequestCharSet()); ByteArrayRequestEntity entity = new ByteArrayRequestEntity( EncodingUtil.getAsciiBytes(content), FORM_URL_ENCODED_CONTENT_TYPE ); return entity; } else { return super.generateRequestEntity(); } }
this.requestEntity = generateRequestEntity();
this.requestEntity = generateRequestEntity();