http
http copied to clipboard
POST parameters are not decoded properly
I'm using req.param() to extract POST request params, but it's not working at all.
Here's what I do:
echo '{"text": "Hello **world**!"}' | curl -d @- http://localhost:8080/
Then in tarantool I print the request as follows:
print(yaml.encode(req:param()))
Then I get this:
---
'{"text": "Hello **world**!"}':
...
If I try to get the "text" parameter using req:param("text"), it returns nil
This works:
http POST localhost:8083/api/rules code=='print("foo")' foo==bar
This doesn't:
http POST localhost:8083/api/rules code='print("foo")' foo=bar
It is the same for req:post_param(name). It returns nil for every name. Although req:json() produces valid json from which it is possible to get parameter.