Changeset 25263558f9eb21ca34ae6dd63f1436c6ce6caeb1

Show
Ignore:
Timestamp:
09/25/09 22:00:35 (5 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1253916035 +0000
git-parent:

[e6b4cf6a1124487d96198a65530f9cf02b65e7d1]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1253916035 +0000
Message:

allow payloads to be sent as well, refs #187

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/modules-lua/noit/HttpClient.lua

    rb82c61f r2526355  
    3030end 
    3131 
    32 function HttpClient:do_request(method, uri, headers
     32function HttpClient:do_request(method, uri, headers, payload
    3333    self.raw_bytes = 0 
    3434    self.content_bytes = 0 
    3535    self.e:write(method .. " " .. uri .. " " .. "HTTP/1.1\r\n") 
     36    if payload ~= nil and string.len(payload) > 0 then 
     37      headers["Content-Length"] = string.len(payload) 
     38    end 
    3639    headers["Accept-Encoding"] = "gzip, deflate"; 
    3740    if headers["User-Agent"] == nil then 
     
    4245    end 
    4346    self.e:write("\r\n") 
     47    if payload ~= nil and string.len(payload) > 0 then 
     48      self.e:write(payload) 
     49    end 
    4450end 
    4551