Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TypeError: Network request failed
- at XMLHttpRequest.xhr.onerror (blob:http://localhost:8081/9b6428f5-4e65-45a0-9490-3852c365f0df:15823:18)
- at XMLHttpRequest.dispatchEvent (blob:http://localhost:8081/9b6428f5-4e65-45a0-9490-3852c365f0df:17900:39)
- at XMLHttpRequest.setReadyState (blob:http://localhost:8081/9b6428f5-4e65-45a0-9490-3852c365f0df:17655:20)
- at XMLHttpRequest.__didCompleteResponse (blob:http://localhost:8081/9b6428f5-4e65-45a0-9490-3852c365f0df:17482:16)
- at blob:http://localhost:8081/9b6428f5-4e65-45a0-9490-3852c365f0df:17592:47
- at RCTDeviceEventEmitter.emit (blob:http://localhost:8081/9b6428f5-4e65-45a0-9490-3852c365f0df:3478:37)
- at MessageQueue.__callFunction (blob:http://localhost:8081/9b6428f5-4e65-45a0-9490-3852c365f0df:2384:44)
- at blob:http://localhost:8081/9b6428f5-4e65-45a0-9490-3852c365f0df:2154:17
- at MessageQueue.__guardSafe (blob:http://localhost:8081/9b6428f5-4e65-45a0-9490-3852c365f0df:2346:11)
- at MessageQueue.callFunctionReturnFlushedQueue (blob:http://localhost:8081/9b6428f5-4e65-45a0-9490-3852c365f0df:2153:14) {stack: TypeError: Network request failed
- at XMLHttpRe…081/9b6428f5-4e65-45a0-9490-3852c365f0df:2153:14),
- message: Network request failed}
- const apiURL = "192.168.1.5:3000/api/";
- fetch(apiURL + '/login', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- body: JSON.stringify({
- username: this.props.username,
- password: this.props.password
- })
- })
- .then((response) => response.json())
- .then((responseJson) => {
- console.log(responseJson);
- })
- .catch((error) => {
- console.log(error);
- });
Add Comment
Please, Sign In to add comment