GETしてきたJSONはrequestでとれると思っていたのですが間違いでしょうか?
@csrf_exempt def json_test(): response = requests.get('http://localhost:8000/app/json_test') print(response.text)
とコードを書き、
とPOSTMAN経由でPOSTするとLodingと出たまま止まってしまいます。
また、
@csrf_exempt def json_test(request): json_list = json.loads(request) print(json_list)
とコードを書くと
TypeError at /app/json_test
the JSON object must be str, bytes or bytearray, not 'WSGIRequest'
とエラーが出ました。
なぜrequestを使っても取れないのでしょうか?
どのように書けばJSONをGETできますか?








回答1件
あなたの回答
tips
プレビュー