/** * Adds a <tt>Content-Type</tt> request header. * * @param state current state of http requests * @param conn the connection to use for I/O * * @throws IOException if an I/O (transport) error occurs. Some transport exceptions * can be recovered from. * @throws HttpException if a protocol exception occurs. Usually protocol exceptions * cannot be recovered from. * * @since 3.0 */ protected void addContentTypeRequestHeader(HttpState state, HttpConnection conn) throws IOException, HttpException { LOG.trace("enter EntityEnclosingMethod.addContentTypeRequestHeader(" + "HttpState, HttpConnection)"); if (!parameters.isEmpty()) { StringBuffer buffer = new StringBuffer(MULTIPART_FORM_CONTENT_TYPE); if (Part.getBoundary() != null) { buffer.append("; boundary="); buffer.append(Part.getBoundary()); } setRequestHeader("Content-Type", buffer.toString()); } }
/** * Adds a <tt>Content-Type</tt> request header. * * @param state current state of http requests * @param conn the connection to use for I/O * * @throws IOException if an I/O (transport) error occurs. Some transport exceptions * can be recovered from. * @throws HttpException if a protocol exception occurs. Usually protocol exceptions * cannot be recovered from. * * @since 3.0 */ protected void addContentTypeRequestHeader(HttpState state, HttpConnection conn) throws IOException, HttpException { LOG.trace("enter EntityEnclosingMethod.addContentTypeRequestHeader(" + "HttpState, HttpConnection)"); if (!parameters.isEmpty()) { StringBuffer buffer = new StringBuffer(MULTIPART_FORM_CONTENT_TYPE); if (Part.getBoundary() != null) { buffer.append("; boundary="); buffer.append(Part.getBoundary()); } setRequestHeader("Content-Type", buffer.toString()); } }
/** * Adds a <tt>Content-Type</tt> request header. * * @param state current state of http requests * @param conn the connection to use for I/O * * @throws IOException if an I/O (transport) error occurs. Some transport exceptions * can be recovered from. * @throws HttpException if a protocol exception occurs. Usually protocol exceptions * cannot be recovered from. * * @since 3.0 */ protected void addContentTypeRequestHeader(HttpState state, HttpConnection conn) throws IOException, HttpException { LOG.trace("enter EntityEnclosingMethod.addContentTypeRequestHeader(" + "HttpState, HttpConnection)"); if (!parameters.isEmpty()) { StringBuffer buffer = new StringBuffer(MULTIPART_FORM_CONTENT_TYPE); if (Part.getBoundary() != null) { buffer.append("; boundary="); buffer.append(Part.getBoundary()); } setRequestHeader("Content-Type", buffer.toString()); } }
/** * Adds a <tt>Content-Type</tt> request header. * * @param state current state of http requests * @param conn the connection to use for I/O * * @throws IOException if an I/O (transport) error occurs. Some transport exceptions * can be recovered from. * @throws HttpException if a protocol exception occurs. Usually protocol exceptions * cannot be recovered from. * * @since 3.0 */ protected void addContentTypeRequestHeader(HttpState state, HttpConnection conn) throws IOException, HttpException { LOG.trace("enter EntityEnclosingMethod.addContentTypeRequestHeader(" + "HttpState, HttpConnection)"); if (!parameters.isEmpty()) { StringBuffer buffer = new StringBuffer(MULTIPART_FORM_CONTENT_TYPE); if (Part.getBoundary() != null) { buffer.append("; boundary="); buffer.append(Part.getBoundary()); } setRequestHeader("Content-Type", buffer.toString()); } }
/** * Adds a <tt>Content-Type</tt> request header. * * @param state current state of http requests * @param conn the connection to use for I/O * * @throws IOException if an I/O (transport) error occurs. Some transport exceptions * can be recovered from. * @throws HttpException if a protocol exception occurs. Usually protocol exceptions * cannot be recovered from. * * @since 3.0 */ protected void addContentTypeRequestHeader(HttpState state, HttpConnection conn) throws IOException, HttpException { LOG.trace("enter EntityEnclosingMethod.addContentTypeRequestHeader(" + "HttpState, HttpConnection)"); if (!parameters.isEmpty()) { StringBuffer buffer = new StringBuffer(MULTIPART_FORM_CONTENT_TYPE); if (Part.getBoundary() != null) { buffer.append("; boundary="); buffer.append(Part.getBoundary()); } setRequestHeader("Content-Type", buffer.toString()); } }