[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LuaSocket problem
- From: LW <lopticon@...>
- Date: Wed, 22 Jul 2009 08:13:23 -0400
Thanks for the reply, Diego.
I got the same reply as well, even when posting the correct UserID, APIKey and CharID (though I did see the added verbage about the 'verb' error if I looked at the packet data using tcpdump or tshark).
.
I wrote a simular statement using perl and received the proper XML datadump I was looking for.
Having done that, I ran tcpdump and tshark to capture what was going on (my network stack knowledge is limited so I was doing a lot of guessing) and noticed a few differences on the structure of the data being sent.
I will post the detailed information once I'm home (just got to work so it will be 8 hours or so from now).
LuaSocket version was 2.0.2
Best,
-LW
On Wed, Jul 22, 2009 at 3:03 AM, Diego Nehab
<diego@tecgraf.puc-rio.br> wrote:
Hi,
local http = require("socket.http")
local io = require("io")
local ltn12 = require("ltn12")
UserID = "userID=XXXXX"
APIKey = "apiKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
CharID = "characterID=XXXXXXX"
--Lame I know...
reqbody = UserID.."&"..APIKey.."&"..CharID
http.request {
method = "POST",
url = "" href="http://api.eve-online.com/char/CharacterSheet.xml.aspx" target="_blank">http://api.eve-online.com/char/CharacterSheet.xml.aspx",
headers= { ["Content-Type"] = "application/x-www-form-urlencoded",
["Content-Length"] = string.len(reqbody),
},
source = ltn12.source.string(reqbody),
sink = ltn12.sink.file(io.stdout)
}
On execution I get an error from the remote server about the request verb
bad.
That's not what happens here. What I get is:
<?xml version='1.0' encoding='UTF-8'?>
<eveapi version="2">
<currentTime>2009-07-22 06:59:17</currentTime>
<error code="106">Must provide userID parameter for authentication.</error>
<cachedUntil>2009-07-22 07:04:17</cachedUntil>
</eveapi>
What version of LuaSocket are you using?
Regards,
Diego