blockchain
blockchain copied to clipboard
request.get_json() returns (Ellipsis, Ellipsis)
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.
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!
I had the exact same issue, the updating version of Flask did it for me too. Thank for the fix.
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!