AS AgentScopeAPI 手册 / API Reference

HttpRequest

public class HttpRequest
源码Source io/agentscope/core/model/transport/HttpRequest.java:28–164

HTTP 请求,与模型服务通信并返回生成或向量化结果。位于 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.

返回Returns String
返回字符串结果。the URL
源码Source io/agentscope/core/model/transport/HttpRequest.java:47–49

getMethod

public String getMethod()

获取HTTP 方法。

Get the HTTP method.

返回Returns String
返回字符串结果。the method (GET, POST, etc.)
源码Source io/agentscope/core/model/transport/HttpRequest.java:56–58

getHeaders

public Map<String, String> getHeaders()

获取请求请求头。

Get the request headers.

返回Returns Map<String, String>
返回映射。an unmodifiable map of headers
源码Source io/agentscope/core/model/transport/HttpRequest.java:65–67

getBody

public String getBody()

获取请求正文。

Get the request body.

返回Returns String
返回字符串结果。the body string, or null if no body
源码Source io/agentscope/core/model/transport/HttpRequest.java:74–76

builder

public static Builder builder()
static

创建用于HttpRequest的构建器。

Create a new builder for HttpRequest.

返回Returns Builder
一种新的构建器实例。a new Builder instance
源码Source io/agentscope/core/model/transport/HttpRequest.java:83–85

嵌套类详情Nested Class Detail

Builder

public static class Builder

HttpRequest的构建器。位于 io.agentscope.core.model.transport 包。核心成员包括 url、method、header、headers、body、build。

Builder for HttpRequest.

基于官方固定版本源码静态生成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.