• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Wish Clear HTTP POST XML Example

 
Michael Finney
Ranch Hand
Posts: 508
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 508
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic