Hello!
On Thu, Aug 13, 2015 at 1:56 AM, kamalp wrote:
> I am having below location configuration and want to change the request
> method from POST to GET.
> location /myweb {
> alias /www/somelocation/;
> access_by_lua_file /www/somelocation/test.lua;
> }
>
> I above sample config request is comminng as POST but before i make a call
> to "ngx.exec()" inside the test.lua, i want to change it to GET method.
> Please let me know can i do.
>
> I tried "ngx.req.set_method(ngx.HTTP_GET)" but it doesn;t work.
I believe this is the way to go. If it does not work for you, please
provide a minimal and standalone example that I can easily run on my
side to reproduce the problem you're seeing. BTW, you may want to
convert the url-encoded arguments in your POST request bodies into
proper querystring in your new GET request's URL. Don't forget that if
that is the case.
Thanks!
-agentzh