AS AgentScopeAPI 手册 / API Reference

HttpRequestTool

public class HttpRequestTool
源码Source io/agentscope/harness/coding/tools/HttpRequestTool.java:31–95

HTTP 请求工具,封装可被智能体调用的能力。位于 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
methodString方法(类型 `String`)。The method.
urlString服务地址(类型 `String`)。The url.
headersMap<String, String>请求头(类型 `Map`)。The headers.
bodyString正文(类型 `String`)。The body.
返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/coding/tools/HttpRequestTool.java:43–89
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.