main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var request = new Request('https://httpbin.org/get', {
        method: 'GET',
        mode: 'cors',
        credentials: 'omit',
        cache: 'only-if-cached',
        referrerPolicy: 'no-referrer'
    });
fetch(request)
    .then(function(response) {
        return response.text();
    })
    .then(function(data) {
        console.log('data = ', data);
    })
    .catch(function(err) {
        console.error(err);
    });
Native Browser JavaScript