0

I am not the best with webservices......let me just preface this question with that.

Anyways, I am attempting to write something that will contact a vendor's server and I have been reading their documentation.

They say that I need to submit a HTTP POST request, but I must also submit some configurations via an HTTP GET also.

I am confused when they say this as I didn't think that these could technically be done at the same time.

Essentially, I need to supply my required XML for the Post. :

<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<!DOCTYPE VendorZ>
<VendorZ Service='Info::Customers'>
<Addr>
        <City>toronto</City>
        <Country>ca</Country>
        <Region>on</Region>
        <Street>133 king st east</Street>
</Addr>
</VendorZ>

But then my url and password settings via a url in an http get. :

http://service.megaupload.com/mega/?Config=pwConfigSettings

I have reviewed a couple links on this website. :

https://stackoverflow.com/questions/92522/http-get-in-vb-net

and

HttpWebRequest with POST and GET at the same time

But I am still fairly confused about how to go about doing this.

I know this isn't really that difficult, but hoping someone can shine some light on this. As I said I have read quite a few posts across the net, but it just isn't clicking for me today.

Any advice/direction is greatly appreciated.

Thanks.

Community
  • 1
  • 1
Bill Blankenship
  • 3,316
  • 6
  • 43
  • 73
  • Are you sure the documentation isn't simply stating you need to make a POST request with query string parameters? It's quite impossible to send a POST and a GET in the same response. – Perception May 01 '12 at 22:35

1 Answers1

1

In some cases, sets of related network-accessible services are called "APIs" . As examples, Google has a "maps API", and Bing has a "search API". Facebook exposes their "Graph API".

an aside:

By my mind, these aren't APIs according to the traditional definition: an application programming interface. Traditionally, an API is set of related function calls - or a class library in an OO environment - exposed by a library module. A programmer would link his code to a library in order to be able to call those APIs.

These network-accessible functions are, to my mind, different. They are application network interfaces, not application programming interfaces. Maybe no one wanted to use the moniker ANI to describe these things. But let's be clear that we are talking about network interfaces here.

Within each ANI/API, whether from Google, Bing, Facebook, or someone else, there are typically numerous functions available. Each of these functions is independently available via some network protocol. In other words, a remote application sends a message, conforming to a particular data format, in order to "use" or "invoke" the function. Each of the network messages is different. Each has independent constraints and requirements.

It sounds to me that some of the functions in the API you are using, require POST. Some require GET. When you want to use function A, then use HTTP POST and send a message formatted thusly; if you want to use function B, then use HTTP GET and format your request this way.

It could be as simple as that.

You wouldn't use them at the same time. You'd use them from the same app, at different times.

Community
  • 1
  • 1
Cheeso
  • 189,189
  • 101
  • 473
  • 713
  • Took me a while to wrap my head around this issue. You are correct that I would use them at different times. But I think in this instance rather than using them for different functions, I would use in them one after the other in order to utilize the specific function I am attempting to use. – Bill Blankenship May 02 '12 at 14:49