Possible Duplicate:
How to use java.net.URLConnection to fire and handle HTTP requests?
I have to send an http post message to a server. This message must have an header and a body and to send it i must use a Stream.
Both the header and the body must be开发者_开发问答 an array of Byte.
How can I do this?
Thank you
From the server you can get header information separately from HttpServletRequest.getHeaders()
. Data should be read in the form of parts (multipart/form-data
) using input stream that can be opened from Request
object. Hope this help.
Ref: http://www.servlets.com/cos/javadoc/com/oreilly/servlet/MultipartRequest.html http://www.jguru.com/faq/view.jsp?EID=1045507
精彩评论