Skip to content

Files

Latest commit

cd1fa1b · Oct 1, 2021

History

History
41 lines (35 loc) · 891 Bytes

post_example.md

File metadata and controls

41 lines (35 loc) · 891 Bytes
title description prev_title prev_link next_title next_link
POST Запити
Як виконувати запити POST за допомогою Axios
Мінімальний приклад
/uk/docs/example
Axios API
/uk/docs/api_intro

Виконання POST запиту

axios.post('/user', {
    firstName: 'Fred',
    lastName: 'Flintstone'
  })
  .then(function (response) {
    console.log(response);
  })
  .catch(function (error) {
    console.log(error);
  });

Виконання декількох одночасних запитів

function getUserAccount() {
  return axios.get('/user/12345');
}

function getUserPermissions() {
  return axios.get('/user/12345/permissions');
}

Promise.all([getUserAccount(), getUserPermissions()])
  .then(function (results) {
    const acct = results[0];
    const perm = results[1];
  });