From: Steven Barth Date: Mon, 2 Mar 2009 19:41:32 +0000 (+0000) Subject: httpclient: default content-type for post data is X-Git-Tag: 0.9.0~642 X-Git-Url: https://git.archive.openwrt.org/?a=commitdiff_plain;h=62a914555e2c037babb939553b8f819bb194c1e9;p=project%2Fluci.git httpclient: default content-type for post data is "application/x-www-form-urlencoded" --- diff --git a/libs/httpclient/luasrc/httpclient.lua b/libs/httpclient/luasrc/httpclient.lua index 767a02ea2..e1b4f83b7 100644 --- a/libs/httpclient/luasrc/httpclient.lua +++ b/libs/httpclient/luasrc/httpclient.lua @@ -152,12 +152,12 @@ function request_raw(uri, options) if type(options.body) == "table" then options.body = http.urlencode_params(options.body) - headers["Content-Type"] = headers["Content-Type"] or - "application/x-www-form-urlencoded" end if type(options.body) == "string" then headers["Content-Length"] = headers["Content-Length"] or #options.body + headers["Content-Type"] = headers["Content-Type"] or + "application/x-www-form-urlencoded" end -- Assemble message