Implementation:Infiniflow Ragflow Api Utils
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Frontend, API, Networking |
| Last Updated | 2026-02-12 06:00 GMT |
Overview
Concrete API utility functions providing endpoint URL construction, request helpers, and response handling for the RAGFlow frontend.
Description
The utils/api.ts module provides helper functions for constructing API endpoint URLs, making authenticated requests, and handling common response patterns. It serves as a thin utility layer above the HTTP client infrastructure.
Usage
Import these utilities when constructing API calls that need URL building or standard response handling patterns.
Code Reference
Source Location
- Repository: Infiniflow_Ragflow
- File: web/src/utils/api.ts
- Lines: 1-330
Signature
// Key exported functions (representative)
export function getApiUrl(path: string): string;
export function buildQueryString(params: Record<string, any>): string;
Import
import { getApiUrl, buildQueryString } from '@/utils/api';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| path | string | Yes | API endpoint path |
| params | Record | No | Query parameters |
Outputs
| Name | Type | Description |
|---|---|---|
| returns | string | Constructed URL with query parameters |
Usage Examples
import { getApiUrl } from '@/utils/api';
const url = getApiUrl('/api/v1/datasets');
fetch(url);
Related Pages
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment