/** * @param requestEntity The requestEntity to set. * * @since 3.0 */ public void setRequestEntity(RequestEntity requestEntity) { clearRequestBody(); this.requestEntity = requestEntity; }
/** * Sets the request body to be the specified inputstream. * * @param body Request body content as {@link java.io.InputStream} * * @deprecated use {@link #setRequestEntity(RequestEntity)} */ public void setRequestBody(InputStream body) { LOG.trace("enter EntityEnclosingMethod.setRequestBody(InputStream)"); clearRequestBody(); this.requestStream = body; }
/** * Clears request body. * * <p>This method must be overwritten by sub-classes that implement * alternative request content input methods</p> * * @since 2.0beta1 */ protected void clearRequestBody() { LOG.trace("enter PostMethod.clearRequestBody()"); this.params.clear(); super.clearRequestBody(); }
/** * Sets the request body to be the specified string. * The string will be submitted, using the encoding * specified in the Content-Type request header.<br> * Example: <code>setRequestHeader("Content-type", "text/xml; charset=UTF-8");</code><br> * Would use the UTF-8 encoding. * If no charset is specified, the * {@link org.apache.commons.httpclient.HttpConstants#DEFAULT_CONTENT_CHARSET default} * content encoding is used (ISO-8859-1). * * @param body Request body content as a string * * @deprecated use {@link #setRequestEntity(RequestEntity)} */ public void setRequestBody(String body) { LOG.trace("enter EntityEnclosingMethod.setRequestBody(String)"); clearRequestBody(); this.requestString = body; }
/** * Adds an array of parameters to be used in the POST request body. Logs a * warning if the parameters argument is null. * * @param parameters The array of parameters to add. * * @since 2.0 */ public void addParameters(NameValuePair[] parameters) { LOG.trace("enter PostMethod.addParameters(NameValuePair[])"); if (parameters == null) { LOG.warn("Attempt to addParameters(null) ignored"); } else { super.clearRequestBody(); for (int i = 0; i < parameters.length; i++) { this.params.add(parameters[i]); } } }
/** * Recycles the HTTP method so that it can be used again. * Note that all of the instance variables will be reset * once this method has been called. This method will also * release the connection being used by this HTTP method. * * @see #releaseConnection() * * @deprecated no longer supported and will be removed in the future * version of HttpClient */ public void recycle() { LOG.trace("enter EntityEnclosingMethod.recycle()"); clearRequestBody(); this.requestContentLength = InputStreamRequestEntity.CONTENT_LENGTH_AUTO; this.repeatCount = 0; this.chunked = false; super.recycle(); }
/** * Adds a new parameter to be used in the POST request body. * * @param paramName The parameter name to add. * @param paramValue The parameter value to add. * * @throws IllegalArgumentException if either argument is null * * @since 1.0 */ public void addParameter(String paramName, String paramValue) throws IllegalArgumentException { LOG.trace("enter PostMethod.addParameter(String, String)"); if ((paramName == null) || (paramValue == null)) { throw new IllegalArgumentException( "Arguments to addParameter(String, String) cannot be null"); } super.clearRequestBody(); this.params.add(new NameValuePair(paramName, paramValue)); }
/** * @param requestEntity The requestEntity to set. * * @since 3.0 */ public void setRequestEntity(RequestEntity requestEntity) { clearRequestBody(); this.requestEntity = requestEntity; }
/** * @param requestEntity The requestEntity to set. * * @since 3.0 */ public void setRequestEntity(RequestEntity requestEntity) { clearRequestBody(); this.requestEntity = requestEntity; }
/** * @param requestEntity The requestEntity to set. * * @since 3.0 */ public void setRequestEntity(RequestEntity requestEntity) { clearRequestBody(); this.requestEntity = requestEntity; }
/** * @param requestEntity The requestEntity to set. * * @since 3.0 */ public void setRequestEntity(RequestEntity requestEntity) { clearRequestBody(); this.requestEntity = requestEntity; }
/** * Sets the request body to be the specified inputstream. * * @param body Request body content as {@link java.io.InputStream} * * @deprecated use {@link #setRequestEntity(RequestEntity)} */ public void setRequestBody(InputStream body) { LOG.trace("enter EntityEnclosingMethod.setRequestBody(InputStream)"); clearRequestBody(); this.requestStream = body; }
/** * Sets the request body to be the specified inputstream. * * @param body Request body content as {@link java.io.InputStream} * * @deprecated use {@link #setRequestEntity(RequestEntity)} */ public void setRequestBody(InputStream body) { LOG.trace("enter EntityEnclosingMethod.setRequestBody(InputStream)"); clearRequestBody(); this.requestStream = body; }
/** * Sets the request body to be the specified inputstream. * * @param body Request body content as {@link java.io.InputStream} * * @deprecated use {@link #setRequestEntity(RequestEntity)} */ public void setRequestBody(InputStream body) { LOG.trace("enter EntityEnclosingMethod.setRequestBody(InputStream)"); clearRequestBody(); this.requestStream = body; }
/** * Sets the request body to be the specified inputstream. * * @param body Request body content as {@link java.io.InputStream} * * @deprecated use {@link #setRequestEntity(RequestEntity)} */ public void setRequestBody(InputStream body) { LOG.trace("enter EntityEnclosingMethod.setRequestBody(InputStream)"); clearRequestBody(); this.requestStream = body; }
/** * Clears request body. * * <p>This method must be overwritten by sub-classes that implement * alternative request content input methods</p> * * @since 2.0beta1 */ protected void clearRequestBody() { LOG.trace("enter PostMethod.clearRequestBody()"); this.params.clear(); super.clearRequestBody(); }
/** * Clears request body. * * <p>This method must be overwritten by sub-classes that implement * alternative request content input methods</p> * * @since 2.0beta1 */ protected void clearRequestBody() { LOG.trace("enter PostMethod.clearRequestBody()"); this.params.clear(); super.clearRequestBody(); }
/** * Clears request body. * * <p>This method must be overwritten by sub-classes that implement * alternative request content input methods</p> * * @since 2.0beta1 */ protected void clearRequestBody() { LOG.trace("enter PostMethod.clearRequestBody()"); this.params.clear(); super.clearRequestBody(); }
/** * Clears request body. * * <p>This method must be overwritten by sub-classes that implement * alternative request content input methods</p> * * @since 2.0beta1 */ protected void clearRequestBody() { LOG.trace("enter PostMethod.clearRequestBody()"); this.params.clear(); super.clearRequestBody(); }
/** * Clears request body. * * <p>This method must be overwritten by sub-classes that implement * alternative request content input methods</p> * * @since 2.0beta1 */ @Override protected void clearRequestBody() { log.trace("enter GenericMethod.clearRequestBody()"); this.params.clear(); super.clearRequestBody(); }