This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Sockets and Internet Protocols and the fly likes need help on posting xml over http Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "need help on posting xml over http" Watch "need help on posting xml over http" New topic

need help on posting xml over http

gaurav gandhi

Joined: Apr 17, 2010
Posts: 2
Hi all,

I am currently working on an application which is based on client-server architecture.

On Client side:
I have to read data from database and send it to the server.
Currently i am sending data using HTTP POST method (using utf-8 encoding).

But now my problem is:

In database, i have a column of CLOB type which contains xml file. I have to fetch this file and then post it to server through HTTP POST.
Fetching part is done but my problem is how to send this file to server through HTTP POST method?

On Server side i have to parse this xml and need to do some validations.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12769
The transmitted request just needs to specify the mime type correctly and setting the text length correctly is a good idea.

See this Wikipedia page.

For example you want the request headers set like:

Content-Length: (your text size)
Content-Type: application/xml

Don't get me started about those stupid light bulbs.
subject: need help on posting xml over http