I am struggling with the process of using an EXE app to access an XML source across the web. A game I play online offers the ability to access character information, item databases, etc. by using an online API. To my knowledge, here is how it works:
The following URL should return an XML file that lists all of the characters on my account:
http://api.eve-online.com/account/Characters.xml.aspx?userID=5050156&apiKey=13DC16F65B424DC4A9479C69A2DA9C1613A1D36EAA1F49A0B93380FAC6F55C69
Here is what I would like to do. I want to be able to receive that XML file and parse it into fields on a form. This is not ASP.NET, this is an executable with VB code pages. I have a form that requests the userID (7-digit number) and the apiKey (encrypted hash key). Here is my source code:
[CODE]
Dim rPost As WebRequest = WebRequest.Create("http://api.eve-online.com/account/Characters.xml.aspx")
Dim sData As String = "userID=" & txUserID.Text & "&apiKey=" & txLimitedAPI.Text
rPost.Method = WebRequestMethods.Http.Post
Dim rsGet As WebResponse = rPost.GetResponse
rsGet = rPost.GetResponse
Dim sr As New StreamReader(rsGet.GetResponseStream(), Encoding.ASCII)
MsgBox("xml data", MsgBoxStyle.Information, sr.ReadToEnd)
[/CODE]
When I execute the code, I get the following error:
The stack trace for the error is:
I have created an account that will allow you to see what is supposed to happen. Here is the userID and the apiKey:
userID: 5050156
apiKey: 13DC16F65B424DC4A9479C69A2DA9C1613A1D36EAA1F49A0B93380FAC6F55C69
My guess is that Im just not using the WebRequest.Http.Post properly, but Microsofts documentation doesnt cover this very well.
Any help would be greatly appreciated.