wood burning stoves 2.0*
The moose likes Web Services and the fly likes Wish Clear HTTP POST XML Example Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "Wish Clear HTTP POST XML Example" Watch "Wish Clear HTTP POST XML Example" New topic
Author

Wish Clear HTTP POST XML Example

Michael Finney
Ranch Hand

Joined: Jan 25, 1999
Posts: 508
Let's say I have a web application which responds to HTTP GET requests and was called via http://something.org/someApp?param1=ok

Now my web application will respond to POST requests where they send XML instead of URL parameters.

Without knowing what language my client will use, I want to provide an API example. With GET HTTP requests, it is clear that one just sends a sample URL.

What is a clear example of sending a POST where XML is sent?

Thanks.
Mike

Michael Finney - "Always Striving To Serve You Better Every Day"
http://www.smilingsoftwaresolutions.com/
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
When you issue a HTTP request, you also have to specify which method your use (i.e. GET, POST, PUT etc).
As you say, with some types of request, i.e. PUT and POST, you can also include a payload, for instance XML or JSON.
Thus, you can issue two HTTP requests with identical URL strings, but with different methods, that yield different results.
I am sorry but I don't quite get this part:
Without knowing what language my client will use, I want to provide an API example. With GET HTTP requests, it is clear that one just sends a sample URL.

Do you mean you want a language-independent example of issuing HTTP requests?
Best wishes!
Michael Finney
Ranch Hand

Joined: Jan 25, 1999
Posts: 508
Thanks for your response.

Ivan Krizsan wrote:
Do you mean you want a language-independent example of issuing HTTP requests?
Best wishes!


What I wanted to avoid was sending them a Java example, because they may be using C# or VB or ....

I know I could populate an HTML form with a POST action specified. That could even be done in more than one way.

It seems like an HTML example is the way to go.
 
GeeCON Prague 2014
 
subject: Wish Clear HTTP POST XML Example