티스토리 뷰
Try
command :$ curl -X POST -H "Content-Type: application/json" 'http://ubuntu:8999/api?aa=11&bb=22'
python script:
arg = request.args
Problem
AttributeError : None type
Cause
... I sent data in json format. but type of request.args is multiDict.
That's why python can't find arg and occur AttributeError.
Solved
arg = request.json
'Python > 환경구축,설정,에러' 카테고리의 다른 글
Connect to Linux(VMware) from Windows by using PuTTY (0) | 2019.06.09 |
---|---|
Create a JSON file in command line and POST it with curl (0) | 2019.06.04 |
[Solved]ERROR: Version in "./docker-compose.yml" is unsupported (0) | 2019.05.30 |
[Solved] curl:(3) malformed (0) | 2019.05.30 |
[Solved]FileNotFoundError:[Errno 2] No such file or directory: '/mnt/hgfs/jinie/flask_base/run.py (1) | 2019.05.30 |