1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| axios({ method: 'post', url: '/user/123', headers: {}, params: {}, data: {}, timeout: 0, responseType: 'json', maxRedirects: 5, onUploadProgress: function (progressEvent) {}, onDownloadProgress: function (progressEvent) {}, validateStatus: function (status) { return status >= 200 && status < 500 } }) .then((rersponse: AxiosResponse) => {}) .catch((error: AxiosError) => { console.log(error.response.status) console.log(error.message) console.log(JSON.parse(error.request.response).message) console.log(`${error.config.baseURL}${error.config.url}`) })
const client = axios.create({ baseURL: '', headers: {} })
|