lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi Team,

I am trying to send Http-POST request, but getting the response as 
<html><body><h1>400 Bad request</h1>
Your browser sent an invalid request.
</body></html>


Here, providing the  Http-POST request, please help us with anything wrong in request forming.

local payload = [[{"email":"evtest@yopmail.com"}]]
    local hdrs = {
        [1] = string.format('host: %s:%s', addr,port),
        [2] = 'Accept: */*',
        [3] = 'Content-Type: application/json',
        [4] = string.format('Content-Length: %d',#payload)
    }


    local req = {
        [1] = 'POST /evl/evIDLookUp HTTP/1.1',
        [2] = table.concat(hdrs, '\r\n'),
        [3] = '\r\n',
        [4] = payload
    }
    req = table.concat(req,  '\r\n')


Thanks,
B.Murali

On Mon, Mar 2, 2020 at 4:11 PM murali <mohan.reddy8@gmail.com> wrote:
Thanks, Sean Conner,

Team any suggestions?

On Mon, Mar 2, 2020 at 11:46 AM Sean Conner <sean@conman.org> wrote:
It was thus said that the Great murali once stated:
> Thanks, Sean Conner,
>
> I have updated the request and the response is in the red color, still am I
> missing anything?

  I don't know as I don't use HAProxy.  I just noticed the HTTP request as
not being properly formed.  And I have no dea what you mean by 'is in the
red color.'

  -spc




--







B.Murali Mohan Reddy


--







B.Murali Mohan Reddy