This is my code:
componentWillMount() { fetch(\"http://10.4.5.114/localservice/webservice/rest/server.php\", { method: \'POST\', body: JSON.stringify({
Try to add header in post request.
headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify({ wstoken: 'any_token', wsfunction: 'any_function', moodlewsrestformat: 'json', username: 'user', password: 'pass', })