[Solved] react native TypeError: Network request failed Unable to symbolicate stack trace: The stack is null

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: