I want to send some data via the Fetch API to the server so that it can query the database based on this. Unlike Ajax, I cannot find a suitable method for this. Here is my request:
{fetch("http://192.168.90.53:4000/game/?email=adicool2294@gmail.com", {method: "GET"} )
.then((response) => response.json())
.then((responseData) => {
id= responseData.id;
name= responseData.name;
console.log(responseData);
})
.catch((error) => {
console.warn(error);
});
}
}
I want to send a parameter such as an email address so that the server can query the DB using this. I am using reactive android, so I cannot use the Ajax request. I want to use only the GET method. Currently, the query parameters that I pass in the URL are not displayed by the server in req.query
source
share