Skip to content

Latest commit

 

History

History
60 lines (49 loc) · 1.33 KB

api_intro.md

File metadata and controls

60 lines (49 loc) · 1.33 KB
title description prev_title prev_link next_title next_link
Axios API'si
Axios API Referansı
POST İstekleri
/docs/post_example
Axios Objesi
/docs/instance

axios metotu uygun bir konfigürasyon ile çağrılarak istek oluşturulabilir

axios(config)
// POST isteği gönderir
axios({
  method: 'post',
  url: '/user/12345',
  data: {
    firstName: 'Efe',
    lastName: 'Ceylan'
  }
});
// Node.js ile uzak sunucudaki fotoğrafı kaydetmek için istek gönderir
axios({
  method: 'get',
  url: 'http://bit.ly/2mTM3nY',
  responseType: 'stream'
})
  .then(function (response) {
    response.data.pipe(fs.createWriteStream('muslum_gurses.jpg'))
  });
axios(url[, config])
// GET isteği gönderir (varsayılan konfigürasyon)
axios('/user/12345');

Takma ada sahip metotlar

Kolaylık için tüm HTTP istek metotlarının adlarına sahip metotlar mevcuttur.

axios.request(config)
axios.get(url[, config])
axios.delete(url[, config])
axios.head(url[, config])
axios.options(url[, config])
axios.post(url[, data[, config]])
axios.put(url[, data[, config]])
axios.patch(url[, data[, config]])
NOT

Kolaylık sağlayan metotları kullanırken url, method, ve data özelliklerinin konfigürasyonda belirtilmesine gerek yoktur.