curl-library
re: multiple line data post from lua
Date: Thu, 6 Sep 2012 10:02:33 -0700
Hi,
Would anyone know how to do a multiple line post of data from curl/Lua - in
Windows?
From Linux, this command works out of box as:
*1)*
data = [[ "http://localhost:8001/myCommand?param1=something¶m2=something"
-d "
#somedata somevalue1
#somedata somevalue2
#enddata"
]]
os.execute("curl " .. data)
However from windows, command *1) *returns *"500 Internal Server Error"*.
So I tried command *2)*, and *3) *both give the same 500 internal server
error
*2) *using long-bracket notation
data = [[ "http://localhost:8001/myCommand?param1=something¶m2=something"
-d "%0A#somedata somevalue1%0A#somedata somevalue2%0A#enddata"]]
os.execute("curl " .. data)
*3)*Using quotes:
data = "\"http://localhost:8001/myCommand?param1=something¶m2=something\"
-d \"%0A#somedata somevalue1%0A#somedata somevalue2%0A#enddata\""
os.execute("curl " .. data)
Many thanks,
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-09-06