Implementation:Infiniflow Ragflow Next Request
| Knowledge Sources | |
|---|---|
| Domains | Frontend, Networking, Infrastructure |
| Last Updated | 2026-02-12 06:00 GMT |
Overview
Concrete Axios-based HTTP client instance with request/response interceptors for authentication, error handling, and token management in the RAGFlow frontend.
Description
The utils/next-request.ts module configures and exports an Axios instance with: request interceptors (attach auth token, set content type), response interceptors (handle 401 unauthorized by redirecting to login, extract data from response envelope), and base URL configuration.
Usage
This is the core HTTP client used by all "next" generation service modules. Import it in service files that need to make authenticated API calls.
Code Reference
Source Location
- Repository: Infiniflow_Ragflow
- File: web/src/utils/next-request.ts
- Lines: 1-146
Signature
const request: AxiosInstance;
export default request;
Import
import request from '@/utils/next-request';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| config | AxiosRequestConfig | Yes | Request configuration |
Outputs
| Name | Type | Description |
|---|---|---|
| returns | AxiosInstance | Configured Axios instance with interceptors |
Usage Examples
import request from '@/utils/next-request';
const response = await request.get('/api/v1/datasets');
const data = response.data;