RemoteHttpClient
public class RemoteHttpClient
源码Source
io/agentscope/runtime/sandbox/manager/remote/RemoteHttpClient.java:35–189远程 HTTP 客户端,封装与远端服务的连接和调用。位于 io.agentscope.runtime.sandbox.manager.remote 包。核心成员包括 makeRequest、getBaseUrl、isConfigured、RemoteHttpClient。
HTTP client for making remote calls to SandboxService server. This client handles the communication with the remote SandboxService service.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public RemoteHttpClient(String baseUrl, String bearerToken) | 初始化 `RemoteHttpClient` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Object makeRequest(RequestMethod method, String endpoint, Map<String, Object> data, String successKey) | 执行 `makeRequest` 方法。 Make an HTTP request to the remote server |
public String getBaseUrl() | 获取基类 URL。 Returns the base url. |
public boolean isConfigured() | 判断是否 `isConfigured`。 Returns whether the configured. |
构造器详情Constructor Detail
RemoteHttpClient
public RemoteHttpClient(String baseUrl, String bearerToken)
初始化 RemoteHttpClient 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
baseUrl | String | 基类 URL(类型 `String`)。The base url. |
bearerToken | String | bearer 令牌(类型 `String`)。The bearer token. |
源码Source
io/agentscope/runtime/sandbox/manager/remote/RemoteHttpClient.java:43–48方法详情Method Detail
makeRequest
public Object makeRequest(RequestMethod method, String endpoint, Map<String, Object> data, String successKey)
执行 makeRequest 方法。
Make an HTTP request to the remote server
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
method | RequestMethod | 方法(类型 `RequestMethod`)。HTTP method (GET, POST, DELETE, etc.) |
endpoint | String | 端点地址(类型 `String`)。Endpoint path (e.g., "/create", "/release") |
data | Map<String, Object> | 数据(类型 `Map`)。Request data |
successKey | String | 成功键(类型 `String`)。Key in response JSON to extract data from |
Object返回对象。Response data
源码Source
io/agentscope/runtime/sandbox/manager/remote/RemoteHttpClient.java:59–109getBaseUrl
public String getBaseUrl()
获取基类 URL。
Returns the base url.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/runtime/sandbox/manager/remote/RemoteHttpClient.java:182–184isConfigured
public boolean isConfigured()
判断是否 isConfigured。
Returns whether the configured.
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/runtime/sandbox/manager/remote/RemoteHttpClient.java:186–188