test

by Trufi

JavaScript

const auth = {
    username: 'sbgisuser',
    password: 'D<mANDN/8bNn,+3j',
};

fetch('https://ever.2gis.ru/sp/account/login', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json-patch+json',
    },
    credentials: 'include',
    body: JSON.stringify(auth),
})
    .then((res) => {
        // console.log(res, res.headers.get('set-cookie'));
        return res.text();
    })
    .then((res) => {
        console.log('login text', res);

        fetch('https://ever.2gis.ru/sp/layers/user.pekazqv2q1ef/features', {
            // fetch('https://ever.2gis.ru/sp/layers', {
            credentials: 'include',
        })
            .then((res) => res.json())
            .then((res) => console.log(res));
    });