You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Preeti Parameswaran <pp...@tibco.com> on 2013/07/11 18:12:10 UTC

adding Mime-Version before the body

Hello

I am new to Http Client, and I tried reading through your archives.
I would like to know if the "Mime-version:1.0" and "ContentType" header can be added just before the request body as specified in RFC 2045 using HttpClient 4.2.5

Here is what my code produces

POST http://localhost:7999/ HTTP/1.1
Content-Type: multipart/related; boundary="--[B@2a9df354"
Connection: close
Mime-Version: 1.0
Content-Length: 278227
Host: localhost:7999
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.2.5 (java 1.5)

----[B@2a9df354
Content-Disposition: form-data; name="Soapmessage@pxd.com"
Content-Type: text/xml;charset=utf-8;; charset=US-ASCII
Content-Transfer-Encoding: 8bit

test
----[B@2a9df354
Content-Disposition: form-data; name="USAHI0965913PR830124.pdf"; filename="USAHI0965913PR830124.pdf"
Content-Type: application/pdf
Content-Transfer-Encoding: binary

Here is what I would need


POST http://localhost:7999/ HTTP/1.1
Content-Type: multipart/related; boundary="--[B@2a9df354"
Connection: close
Mime-Version: 1.0
Content-Length: 278227
Host: localhost:7999
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.2.5 (java 1.5)

Mime-Version: 1.0
Content-Type: multipart/related; boundary="--[B@2a9df354"


----[B@2a9df354
Content-Disposition: form-data; name="Soapmessage@pxd.com"
Content-Type: text/xml;charset=utf-8;; charset=US-ASCII
Content-Transfer-Encoding: 8bit

test
----[B@2a9df354
Content-Disposition: form-data; name="USAHI0965913PR830124.pdf"; filename="USAHI0965913PR830124.pdf"
Content-Type: application/pdf
Content-Transfer-Encoding: binary

Regards,
Preeti Parameswaran
TIBCO PSG, NA
614-271-7596
pparames@tibco.com