using location.capture to post a form

Yichun Zhang (agentzh) agentzh at gmail.com
Tue Sep 16 18:51:37 UTC 2014


Hello!

On Tue, Sep 16, 2014 at 11:24 AM, jpsonweb wrote:
>  I am calling an webapplication from nginx.  I want to capture the response
> and post the response body as a post parameter to another application.
> I am doing something like this
>  local maken_res = ngx.location.capture("/test", { method = ngx.HTTP_POST
> ,body =  "name = John"})
>   The post goes through but receiving application does not get request
> parameter.
>

I think you also need to pass the request header "Content-Type:
application/x-www-form-urlencoded" to your subrequest because your
"receiving application" might require that.

Regards,
-agentzh



More information about the nginx mailing list