TGViewer
Google Таблицы Google Таблицы @google_sheets · 60.3K subscribers
Post #2238 4.93K
Часть 2, Что сделать в GAS-скрипте, чтобы переадресовывать запрос на этот VPS и получать данные обратно

Пример простого GET-запроса:


function rqst() {
const apiToken = 'ваш токен от API';
const url = 'endPoint API';
const proxyUrl = 'адрес нашего VPS';

const payload = {
path: url,
method: 'GET',
headers: {
'User-Agent': 'Mozilla/5.0',
'Accept': 'application/json',
'Authorization': 'Bearer ' + apiToken
}
};

const response = UrlFetchApp.fetch(proxyUrl, {
method: 'post',
contentType: 'application/json',
payload: JSON.stringify(payload),
muteHttpExceptions: true
});

return JSON.parse(response.getContentText());
}
  • 🔥 3
  • 🍓 1
More from @google_sheets
  1. Sep 27, 2026Женя привет, хотел пожелать тебе удачи и не отчаиваться. Все у тебя будет хорошо. Отправил…
  2. Sep 26, 2026Ребят, впервые прошу о помощи и надеюсь, что в последний раз https://t.me/google_sheets/22…
  3. Sep 26, 2026Уже помог, я формулы научился читать, немного писать, сейчас js-курс простой базовый начал…
  4. Sep 26, 2026Постараюсь помочь
  5. Sep 26, 2026Будут любые вопросы - пиши
  6. Sep 26, 2026Google Таблицы pinned a photo
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →