AngularJSの7.1.1を利用しています。postする部分を以下のように書いています。
これだと、エラーになってしまいます。
url = 'http://127.0.0.1:8000/post'; para = ''; json_post(name: any): boolean { this.para = JSON.stringify({name: name}); return this.http.post(this.url, this.para, {headers: new HttpHeaders({ 'Content-Type': 'application/json' })}).subscribe(); }
サーバの方は以下のようにしています。
@csrf_exempt def post(request): data = json.loads(request.body) json.dumps(data) : return HttpResponse( True )
postしたサーバのフラグを受け取るためにはどのようにすればいいのでしょうか。ご教授をお願いします。
日本語のドキュメントを確認したのですが、わかりませんでした。ここを確認したら、わかりますよという箇所を教えていただけると
助かります。
あなたの回答
tips
プレビュー