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

How to '/add_json' in the example? #41

Closed
qiukun opened this issue Dec 10, 2014 · 2 comments
Closed

How to '/add_json' in the example? #41

qiukun opened this issue Dec 10, 2014 · 2 comments

Comments

@qiukun
Copy link

qiukun commented Dec 10, 2014

looks like the body would be always empty for a GET

@ipkn
Copy link
Owner

ipkn commented Dec 15, 2014

I changed the routing implementation and now the default HTTP method is GET only.

In the HTTP standard, GET request cannot have a request body. Some HTTP client library sends a request with empty body only, some ignores the standard and sends the body too.

The example should changed to

    CROW_ROUTE(app, "/add_json")
        .methods("POST"_method)
    ([](const crow::request& req){

and the request use POST method. Then it will work again I think.

I pushed a fixed version. Can you check it with POST method?

@ipkn
Copy link
Owner

ipkn commented Mar 2, 2015

Fixed README.md too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants