N
N
NooBick2021-05-03 00:19:04
In contact with
NooBick, 2021-05-03 00:19:04

What's wrong with react native fetch?

await fetch('http://0s.mfygs.ozvs4y3pnu.nblu.ru/method/users.get?v=5.92&access_token=123', {
            method: 'GET',
            mode: 'no-cors',
            //cache: 'no-cache',
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
                'Accept': 'application/json',
                'Access-Control-Allow-Origin': 'http://example.com',
            },
            //redirect: 'follow', // manual, *follow, error
            //referrerPolicy: 'no-referrer', // no-referrer, *client
        })


608f170c48d13898788826.png
608f1723a363f583607803.png

There is no response from the server, but there should be this response:
608f1742b429a678315883.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Aleksandrovich, 2021-05-03
@RomReed

Well, the first thing to do is try to put the token not in the url, but in the header. The second is to try to disable cors either through the Google chrome extension or through Google chrome itself (google how to do it there is nothing complicated). And of course, if you have access to the api developer, then you should ask him.

Q
qqweer, 2021-05-09
@hawkkiller

I would suggest using axios instead of fetch. The tool will be cooler.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question