10 October, 2024

AXIN8 – Xóa dữ liệu với DELETE request

Bước 1: Tạo Axios Instance Đầu tiên, chúng ta tạo một file axiosInstance.js để tạo một instance của Axios. Bước 2: Sử dụng Axios Instance trong một React Component Sau khi tạo instance của Axios, chúng ta sử dụng nó trong một component React để thực hiện yêu cầu DELETE và xử lý phản hồi. […]

2 mins read

AXIN6 – Gửi dữ liệu với POST request

Bước 1: Tạo Axios Instance Đầu tiên, chúng ta tạo một file axiosInstance.js để tạo một instance của Axios. Bước 2: Sử dụng Axios Instance trong một React Component Sau khi tạo instance của Axios, chúng ta sử dụng nó trong một component React để gửi dữ liệu qua POST request và xử lý phản […]

2 mins read

AXIN4 – Xử lý lỗi trong các yêu cầu HTTP

Bước 1: Tạo Axios Instance với Interceptor Đầu tiên, chúng ta tạo một file axiosInstance.js để tạo một instance của Axios và thêm Interceptor để xử lý lỗi. Bước 2: Sử dụng Axios Instance trong một React Component Sau khi tạo instance của Axios với Interceptor, bạn có thể sử dụng nó trong các component […]

3 mins read