I’m writing an aspx page which has to send an http request to a known url with some parameters whose values are retrieved at runtime, then receive the response in xml form.
For example, the user presses the ‘order’ button so I have to send its order to http://foobar/xyz.do with parameter ‘abc’ being ‘123’ and parameter ‘def’ being ‘456’, then receive the response which could be something like < error code=332 > wtf?! < /error >’.
I don’t even know where to start 😉
Cheers
You can use
WebRequestclass in the event handler of your order button. In other words, when the order button is pressed, you might run a code similar to this:Now, if the response is XML, you should use something like
LINQ to XMLor simplyXmlDocumentrelated classes to parse it. Otherwise, do appropriately.