用于显示请求体章节的组件。
Loading...
安装
使用方法
import { RequestBodySection } from "@/components/pivot/request-body-section";
<RequestBodySection />
示例
基本用法
<RequestBodySection />
API 参考
Props
属性 | 类型 | 默认值 | 描述 |
---|---|---|---|
className | string | - | 额外的 CSS 类名 |
Search for a command to run...
包含完整用户信息的 JSON 请求体,包含验证规则和嵌套对象
{
"email": "john.doe@example.com",
"name": "John Doe",
"password": "SecurePass123",
"age": 28,
"phone": "+1-555-123-4567",
"address": {
"street": "123 Main St",
"city": "Anytown",
"state": "CA",
"zipCode": "12345",
"country": "US"
},
"preferences": {
"theme": "dark",
"newsletter": true,
"notifications": true
}
}
支持多种内容类型的文件上传,包含 multipart/form-data 和 JSON 格式
可选的 PATCH 请求体,支持部分字段更新和复杂的嵌套结构
{
"name": "iPhone 15 Pro Max",
"description": "最新款 iPhone,配备 A17 Pro 芯片和钛金属设计",
"price": 1199.99,
"currency": "USD",
"category": "Electronics",
"tags": [
"smartphone",
"apple",
"5g",
"premium"
],
"specifications": {
"screen_size": "6.7 inches",
"storage": "256GB",
"color": "Natural Titanium",
"camera": "48MP Main + 12MP Ultra Wide + 12MP Telephoto"
},
"inventory": {
"quantity": 100,
"lowStockThreshold": 10,
"trackInventory": true
},
"status": "active"
}
批量处理多个项目的请求体,包含操作类型和选项配置
{
"operation": "update",
"items": [
{
"id": "item_001",
"data": {
"status": "active",
"priority": "high"
}
},
{
"id": "item_002",
"data": {
"status": "inactive",
"priority": "low"
}
}
],
"options": {
"skipValidation": false,
"continueOnError": true,
"dryRun": false
}
}