satwikkansal / python_blockchain_app

A fully functional blockchain application implemented in Python from scratch (with tutorial).
819 stars 471 forks source link

curl -XPOST to \register_with throwing code error #37

Closed ptr-r-thompson closed 4 years ago

ptr-r-thompson commented 4 years ago

I am new to all of this, including Python, Flask, json, and venv. I have found my way through all issues, but am faced with one I can't resolve.

When I apply all the curl commands to execute the \register_with endpoint, I get an error showing that the the json object in the POST is not subscriptable - a 'NoneType' object is returned. What is up?

Screenshot shows my two nodes running node_server.py, the additional cmd shell with the curl statement, and the node 8001 error message on line 219 of node_server.py. I can't figure this out. Any assistance is appreciated.

image

I hope this image comes through and is useful, I am also new to GitHub.

While this is not a critical issue to my current project (I am expanding some features and functionality for a Python class final project) I would like to understand my failing and further understand this application and how it functions.

Thanks, Peter Thompson

satwikkansal commented 4 years ago

I doubt that you're using spcial quotes instead of normal quotes in the cURL request (this kind of issue may happen while copy-pasting). I'll recommend using a client like Postman, import the curl there, and hit it.