Closed SWSAmor closed 7 years ago
Hi,
sorry for the late answer (deals & vacation)
tnt_pass_http_request on parse_args;
parse_args means that nginx will do parsing query args and those parsed args will be added into the req table (it's first argument).
tnt_pass_http_request on parse_args pass_body;
pass_body means that nginx will not parse body by using JSON parser. The body will be in the req table. This option exists only for passing non standard data, like image and so on.
If this options is not set, then nginx will wait for JSON in the body ({"params": [1, 2, {"str": 1}]}) the body will be in Lua like:
function foo(req, one, two, obj)
one -- = 1
two -- = 2
obj.str -- = 1
end
Thank you for the clarification. What will be happening if i do not set pass_body, and the body is empty or not a json?
Well, you will have 'bad request' at client side. If be honestly I don't like 'pass_body' feature, that function appeared because some of my users wish to have some method to transfer image into the tarantool over https. It was fast hack...
Nowadays I'm tring to add more types of body, for instance nginx can transfer urlencoded.
If you have some good ideas you are welcome, feel free and create an issue :)
I'm developing an API based on JSON API and i should and want to control most of the responses. For JSON API custom statuses and custom response bodies needed. Because of that i should get all of bodies and need to analyze them on the Tarantool side. Actually my work based on pass body. :-) I think i love pass_body. ;-) Very good fast hack, thank you. 👍
I followed the instructions in https://github.com/tarantool/nginx_upstream_module#http-headers-and-status but i think it's a bit ambiguous:
I don't get any body with
but get body with
this way i get
with the body, but i need body without that. That's because i don't understand hide in this:
because it says hide
{"params": [...]}
from a user, but without theit works flawlessly.
Perhaps my bad. Sry.