blockchain icon indicating copy to clipboard operation
blockchain copied to clipboard

request.get_json() returns (Ellipsis, Ellipsis)

Open ceceba223 opened this issue 3 years ago • 3 comments

I'm trying to follow this article on building a simple blockchain. But right now I'm stuck at step 3: "Interacting with our Blockchain" I tried accessing the http://localhost:5000/transactions/new using cURL with the following commands:

curl -X POST -H "Content-Type: application/json" -d '{"sender": "d4ee26eee15148ee92c6cd394edd974e", "recipient": "a4ee26eee15148ee92c6cd394edd974e", "amount": 5}' "http://localhost:5000/transactions/new"

curl --header "Content-Type: application/json" --request POST --data '{"sender": "f3ba8", "recipient": "b5d29", "amount": 5}' http://localhost:5000/transactions/new

Both return "Missing values" and if i print out the values variable it says "(Ellipsis, Ellipsis)". I already tried to use postman for the request, but still got the same error. I also tried to copy & paste the finished code from this repo to check if I made a mistake while following the steps in the article.

It seams to as if there is something wrong with my cURL command but i can't figure out what.

ceceba223 avatar Jun 28 '21 20:06 ceceba223

I was able to solve the problem.

the problem is in the Flask version of the original article, try to reinstall it and it should work!

vreabernardo avatar Jul 17 '21 22:07 vreabernardo

I had the exact same issue, the updating version of Flask did it for me too. Thank for the fix.

stremblayIntelener avatar Dec 10 '21 19:12 stremblayIntelener

I had the exact same issue. You are a Godsend. Thank you! I had flask 0.12.2 and updated to the latest 2.2.2 and even the deprecated request.json worked like a charm!

salmanfarsi100 avatar Jan 10 '23 14:01 salmanfarsi100