lua-users home
lua-l archive

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


Hi all,

I'm running into some problems when I try to query data from an exchange api through https when using luasockets + luasec. When I perform the same query using python I get the expected data back but when done with lua I keep getting back "{"error":"Invalid command."}".

To make this issue easier to reproduce I've created a dummy account on the exchange along with the associated secret api keys used in the scripts below.

Lua test query:    http://pastebin.com/Lt5PjwnN
Python test query: http://pastebin.com/PzgGm7TU

The api doc for the exchange in question: https://poloniex.com/api

I've checked the usual things like urlencoding and sha512 hmac signatures and they both match between the two scripts. For the life of me, I cannot figure out why this works fine in python but not in lua!

Is there some difference in the way luasec and luasockets is performing the https POST request that differs from the python version using urllib? What could be causing the problem?

Thanks!