TypeError: Network request failed
Unable to symbolicate stack trace: The stack is null
Through the analysis, it can be seen that it is a network request problem. In react native, try to find the problem caused by the fetch sending request.
Code for fetch:
fetch('http://localhost:8083/user/getAllUser', { method: 'POST', headers: { "Accept": "application/json", "Content-Type": 'application/json', "Connection": "close", "type": "getUserData", }, mode : "cors", body : JSON.stringify({ page : 1, type :0 }) }) .then((response) => response.json()) .then((responseJson) => { console.log(responseJson); return responseJson.movies; }) .catch((error) => { console.error(error); }); During the test, the error is prompted. 1. the http request received by the Android side must be an ip, i.e. the access address must be an IP address
2. The request header must contain the following
Similar Posts:
- Two solutions to cross origin read blocking (CORB) blocked cross origin response error of Web Service API
- [Solved] Vue Axios error: TypeError: Cannot set property ‘tableData‘ of undefined
- Uncaught SyntaxError: Unexpected token o
- Provisional headers are shown
- [Solved] Cannot deserialize instance of `java.lang.String` out of START_OBJECT token
- Ajax “SyntaxError: missing ; before statement” [How to Solve]
- Vue Error: [Vue warn]: Error compiling template:Templates should only be responsible for mapping…
- [Solved] Unapp H5 Error: Access to XMLHttpRequest at ‘http://www.localtest.com/api/api/v1/job/getPositionList’…
- What does HTTP status code 304 mean
- Access to XMLHttpRequest at ‘http://localhost:9990/’ from origin ‘http://IP:Port’ has been blocked by CORS policy…more-private address space `local`