lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Just a type-o on my part..  no problems w/ the execution of the script. :)

Thanks for the reply though!

-LW




On Sat, Jul 25, 2009 at 7:29 PM, Greg Ludwig <greg@groupscope.com> wrote:
Hi, I don't know anything about LuaSocket, but I did notice the
first line of your script is

#!/usr/loca/bin/lua

perhaps it should be

#!/usr/local/bin/lua

or this might just be a typo in your post, or maybe you
really do have a "/usr/loca" directory...

--Greg


LW <lopticon@gmail.com> wrote:
> I recently downloaded LuaSocket and started a small project to help me learn
> lua.
> So I took an old perl project I did a few years back and started porting it
> and adding
> features.
> For the network (web) piece I ran into a problem connecting to an IIS web
> server.
> On execution I get an error from the remote server about the request verb
> bad.
>
> A couple of things to note:
> After a bit of googling I found one post on a forum that
> suggested some versions of IIS are picky about headers
> so this lead me to change header casing in the adjustheaders function.
> It was also suggested to add a simple function to adjust the header casing
> from lower to capitalize.. Just above the adjustheaders I added a function
> for this
> and I'm still getting the, "request verb being bad".
>
> Below is the code in question:
> Does anyone see anything out of the obvious?
>
> #!/usr/loca/bin/lua
>
> 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)
>
> }
>
>
> Thanks,
> -LW
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
http://bazar2.conectiva.com.br/mailman/private/lua/attachments/20090717/6bb2369a/attachment-0001.html
>
> End of Lua Digest, Vol 163, Issue 5
> ***********************************
>