4
私は新しいネイティブの反応で取り出して、this tutorialに続いています。
プライベートAPIサーバーにjson本体を送信しようとしていますが、サーバーログをチェックして、本文の内容が空であることがわかりました。ネイティブ反応では、ヘッダSことshoueldのでここ ネイティブフェッチに反応しません本文を送信しません
は
authenticateLogIn(){
fetch('<URL>', {
method: 'POST',
header: {'Content-Type': 'application/json', 'Accept': 'application/json'},
body: JSON.stringify({'username': '<username>', 'password':'<password>'})
})
.then((incoming) => incoming.json())
.then((response) => {
console.log(response.header);
Alert.alert(JSON.stringify(response.body));
})
.done();
ああ、それは常にそれがちょうど1つのヘッダS – XPLOT1ON