api_call
Execute HTTP requests to REST APIs by specifying method, path, parameters, headers, and body data for testing and integration.
Instructions
调用示例API API的通用工具。支持所有HTTP方法和路径。
Input Schema
Name | Required | Description | Default |
---|---|---|---|
body | No | 请求体数据(用于POST/PUT等方法) | |
headers | No | 请求头,例如: {"Authorization": "Bearer token"} | |
method | Yes | HTTP方法 | |
path | Yes | API路径,例如: /users/{id} 或 /posts | |
pathParams | No | 路径参数,例如: {"id": "123"} | |
queryParams | No | 查询参数,例如: {"limit": 10, "offset": 0} |
Input Schema (JSON Schema)
{
"properties": {
"body": {
"additionalProperties": true,
"description": "请求体数据(用于POST/PUT等方法)",
"type": "object"
},
"headers": {
"additionalProperties": true,
"description": "请求头,例如: {\"Authorization\": \"Bearer token\"}",
"type": "object"
},
"method": {
"description": "HTTP方法",
"enum": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH",
"HEAD",
"OPTIONS"
],
"type": "string"
},
"path": {
"description": "API路径,例如: /users/{id} 或 /posts",
"type": "string"
},
"pathParams": {
"additionalProperties": true,
"description": "路径参数,例如: {\"id\": \"123\"}",
"type": "object"
},
"queryParams": {
"additionalProperties": true,
"description": "查询参数,例如: {\"limit\": 10, \"offset\": 0}",
"type": "object"
}
},
"required": [
"method",
"path"
],
"type": "object"
}