teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

5

追記

2020/07/18 04:17

投稿

study_111
study_111

スコア82

title CHANGED
File without changes
body CHANGED
@@ -149,4 +149,4 @@
149
149
  import axios from 'axios';
150
150
  const headers = {"X-CSRFTOKEN": "<csrf_token_very_long_string_goes_here>"}
151
151
  ```
152
- axios.postメソッドには、``` {headers: headers},```を追しました
152
+ axios.postメソッドには、``` {headers: headers},```を引数にしました

4

追記

2020/07/18 04:17

投稿

study_111
study_111

スコア82

title CHANGED
File without changes
body CHANGED
@@ -142,4 +142,11 @@
142
142
  },
143
143
 
144
144
  )
145
- ```
145
+ ```
146
+ ### 追記2
147
+ [こちら](https://manikos.github.io/django-axios-and-csrf-token)の記事を参考に以下の部分をApp.vueに追記しましたが、エラーは解決されていない状況です。
148
+ ```
149
+ import axios from 'axios';
150
+ const headers = {"X-CSRFTOKEN": "<csrf_token_very_long_string_goes_here>"}
151
+ ```
152
+ axios.postメソッドには、``` {headers: headers},```を追記しました。

3

コード修正

2020/07/18 04:16

投稿

study_111
study_111

スコア82

title CHANGED
File without changes
body CHANGED
@@ -132,7 +132,7 @@
132
132
  [Qiita](https://qiita.com/att55/items/2154a8aad8bf1409db2b)記事を参考に、axiosに```withCredentials: true```を追記しましたが```POST http://127.0.0.1:8000/polls/check/ 403 (Forbidden)```が表示されている状態です。
133
133
  ```
134
134
  axios.post(
135
- 'http://127.0.0.1:8000/security_tool/check/',
135
+ 'http://127.0.0.1:8000/polls/check/',
136
136
  {
137
137
  name:this.name,
138
138
  comment:this.comment

2

追記

2020/07/18 03:47

投稿

study_111
study_111

スコア82

title CHANGED
File without changes
body CHANGED
@@ -126,4 +126,20 @@
126
126
  ### 補足情報(FW/ツールのバージョンなど)
127
127
  エディター:VScode,OS:Mac OS
128
128
 
129
- どなたか、エラー解決の為、アドバイス頂けましたら幸いです。
129
+ どなたか、エラー解決の為、アドバイス頂けましたら幸いです。
130
+
131
+ ### 追記
132
+ [Qiita](https://qiita.com/att55/items/2154a8aad8bf1409db2b)記事を参考に、axiosに```withCredentials: true```を追記しましたが```POST http://127.0.0.1:8000/polls/check/ 403 (Forbidden)```が表示されている状態です。
133
+ ```
134
+ axios.post(
135
+ 'http://127.0.0.1:8000/security_tool/check/',
136
+ {
137
+ name:this.name,
138
+ comment:this.comment
139
+ },
140
+ {
141
+ withCredentials: true
142
+ },
143
+
144
+ )
145
+ ```

1

文法修正

2020/07/18 03:47

投稿

study_111
study_111

スコア82

title CHANGED
File without changes
body CHANGED
@@ -124,4 +124,6 @@
124
124
  },
125
125
  ```
126
126
  ### 補足情報(FW/ツールのバージョンなど)
127
- エディター:VScode,OS:Mac OS
127
+ エディター:VScode,OS:Mac OS
128
+
129
+ どなたか、エラー解決の為、アドバイス頂けましたら幸いです。