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.

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

local payload = [[{"email":""}]]
    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')


On Mon, Mar 2, 2020 at 4:11 PM murali <> wrote:
Thanks, Sean Conner,

Team any suggestions?

On Mon, Mar 2, 2020 at 11:46 AM Sean Conner <> 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.'



B.Murali Mohan Reddy


B.Murali Mohan Reddy