3

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

1
  • 2
    See this thread. In particular, the section titled "Streaming Mode". Commented Sep 20, 2011 at 15:06

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.