diff --git a/examples/cURLv3/post_json.lua b/examples/cURLv3/post_json.lua new file mode 100644 index 0000000..f41f8f0 --- /dev/null +++ b/examples/cURLv3/post_json.lua @@ -0,0 +1,12 @@ +local cURL = require "cURL" + +c = cURL.easy{ + url = "http://posttestserver.com/post.php", + post = true, + httpheader = { + "Content-Type: application/json"; + }; + postfields = '{"hello": "world"}'; +} + +c:perform() \ No newline at end of file diff --git a/src/lua/cURL/impl/cURL.lua b/src/lua/cURL/impl/cURL.lua index dac178c..ea1b7d0 100644 --- a/src/lua/cURL/impl/cURL.lua +++ b/src/lua/cURL/impl/cURL.lua @@ -681,7 +681,7 @@ function Multi:setopt(k, v) end if k == curl.OPT_SOCKETFUNCTION then - return self:setopt_httppost(wrap_socketfunction(v)) + return self:setopt_socketfunction(v) end return setopt(self, k, v)