【发布时间】:2021-05-19 05:25:11
【问题描述】:
const requestOptions = {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"username": "mukesh",
"password": "1234"
})
};
var url = 'http://ewayswork.com:9000/customer/'
fetch(url, requestOptions)
.then(response => response.json())
.then(data => {
console.log(data)
})
.catch(function(error) {
console.log('Problem with your fetch operation: ' + error.message);
});
【问题讨论】:
-
请同时上传您的网址。
标签: react-native fetch rest