HttpRequestTool
public class HttpRequestTool
源码Source
io/agentscope/harness/coding/tools/HttpRequestTool.java:31–95HTTP 请求工具,封装可被智能体调用的能力。位于 io.agentscope.harness.coding.tools 包。核心成员包括 http_request、HttpRequestTool。
Makes arbitrary HTTP requests with configurable method, headers, and body.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public HttpRequestTool() | 初始化 `HttpRequestTool` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String http_request(String method, String url, Map<String, String> headers, String body) | 执行HTTP 请求相关操作。 Performs the http request operation. |
构造器详情Constructor Detail
HttpRequestTool
public HttpRequestTool()
初始化 HttpRequestTool 实例。
Creates a new instance.
源码Source
io/agentscope/harness/coding/tools/HttpRequestTool.java:35–41方法详情Method Detail
http_request
public String http_request(String method, String url, Map<String, String> headers, String body)
执行HTTP 请求相关操作。
Performs the http request operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
method | String | 方法(类型 `String`)。The method. |
url | String | 服务地址(类型 `String`)。The url. |
headers | Map<String, String> | 请求头(类型 `Map`)。The headers. |
body | String | 正文(类型 `String`)。The body. |
String返回字符串结果。Returns a string.
源码Source
io/agentscope/harness/coding/tools/HttpRequestTool.java:43–89