Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST parameters are not decoded properly #39

Open
knazarov opened this issue Feb 22, 2017 · 2 comments
Open

POST parameters are not decoded properly #39

knazarov opened this issue Feb 22, 2017 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@knazarov
Copy link
Contributor

knazarov commented Feb 22, 2017

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

@knazarov knazarov added the bug Something isn't working label Feb 22, 2017
@knazarov
Copy link
Contributor Author

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

@Muzicius
Copy link

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.

@kostja kostja added the good first issue Good for newcomers label Feb 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants