HttpRequest
public class HttpRequest
源码Source
io/agentscope/core/model/transport/HttpRequest.java:28–164HTTP 请求,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.core.model.transport 包。核心成员包括 getUrl、getMethod、getHeaders、getBody、builder。
HTTP request encapsulation for the transport layer.
This class represents an HTTP request with URL, method, headers, and body. Use the builder pattern to construct requests.
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
Builder | 类class | HttpRequest的构建器。 Builder for HttpRequest. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String getUrl() | 获取请求 URL。 Get the request URL. |
public String getMethod() | 获取HTTP 方法。 Get the HTTP method. |
public Map<String, String> getHeaders() | 获取请求请求头。 Get the request headers. |
public String getBody() | 获取请求正文。 Get the request body. |
public static Builder builder()static | 创建用于HttpRequest的构建器。 Create a new builder for HttpRequest. |
方法详情Method Detail
getUrl
public String getUrl()
获取请求 URL。
Get the request URL.
String返回字符串结果。the URL
源码Source
io/agentscope/core/model/transport/HttpRequest.java:47–49getMethod
public String getMethod()
获取HTTP 方法。
Get the HTTP method.
String返回字符串结果。the method (GET, POST, etc.)
源码Source
io/agentscope/core/model/transport/HttpRequest.java:56–58getHeaders
public Map<String, String> getHeaders()
获取请求请求头。
Get the request headers.
Map<String, String>返回映射。an unmodifiable map of headers
源码Source
io/agentscope/core/model/transport/HttpRequest.java:65–67getBody
public String getBody()
获取请求正文。
Get the request body.
String返回字符串结果。the body string, or null if no body
源码Source
io/agentscope/core/model/transport/HttpRequest.java:74–76builder
public static Builder builder()
static
创建用于HttpRequest的构建器。
Create a new builder for HttpRequest.
Builder一种新的构建器实例。a new Builder instance
源码Source
io/agentscope/core/model/transport/HttpRequest.java:83–85嵌套类详情Nested Class Detail
Builder
public static class BuilderHttpRequest的构建器。位于 io.agentscope.core.model.transport 包。核心成员包括 url、method、header、headers、body、build。
Builder for HttpRequest.