You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
local pegasus = require 'pegasus'
local server = pegasus:new({
host='127.0.0.1',
port='9090',
location='root/'
})
server:start(function (req, res)
local h = req:headers()
local data = req:receiveBody()
print(data)
res:addHeader('Content-Type', 'text/html'):write('hello pegasus world!')
end)
I needed to call req:headers() to ensure that the content length attribute of req is set correctly, without this I couldn't get the body of the post request.
Have I misunderstood or is this expected behavior?
I'd be willing to attempt a fix if you're good with that.
Thanks in advance.
The text was updated successfully, but these errors were encountered:
@EvandroLG see #139 also created some other smaller indepedent PR's from the bigger one. Please review one-by-one, once merged I'll rebase the bigger one
In my trivial example.
I needed to call req:headers() to ensure that the content length attribute of req is set correctly, without this I couldn't get the body of the post request.
Have I misunderstood or is this expected behavior?
I'd be willing to attempt a fix if you're good with that.
Thanks in advance.
The text was updated successfully, but these errors were encountered: