1
私のReact Nativeプロジェクトからoauth/tokensを使用してログインしようとしています。私はPOSTMANでテストしました。私がAxiosからデータを送信するとうまくいきます。私は私のアプリから送信しようとすると、しかし、それは私にエラーを与える:ステータスコードで失敗した要求400 私のコードは次のとおりです。lactvelパスポートを使用してoauth/tokenに投稿するとネイティブ応答400が返される
axios({
method: 'post',
url: 'http://183.172.100.84:8000/oauth/token',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
},
data: {
client_id : '2',
client_secret : 'secret',
grant_type : 'password',
email : this.state.userEmail,
password : this.state.userPassword
}
})
.then((response) => {
console.log(response.data);
})
Telerik fiddlerのようなスニファを使用して、データが正しく形成されていることを確認してください。 –