类 HttpRequest.Builder
java.lang.Object
io.agentscope.core.model.transport.HttpRequest.Builder
- 封闭类:
HttpRequest
Builder for HttpRequest.
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Set the request body.build()Build the HttpRequest.Add a header to the request.Add multiple headers to the request.Set the HTTP method.Set the request URL.
-
构造器详细资料
-
Builder
public Builder()
-
-
方法详细资料
-
url
Set the request URL.- 参数:
url- the URL- 返回:
- this builder
-
method
Set the HTTP method.- 参数:
method- the method (GET, POST, etc.)- 返回:
- this builder
-
header
Add a header to the request.- 参数:
name- the header namevalue- the header value- 返回:
- this builder
-
headers
Add multiple headers to the request.- 参数:
headers- the headers to add- 返回:
- this builder
-
body
Set the request body.- 参数:
body- the body string- 返回:
- this builder
-
build
Build the HttpRequest.- 返回:
- a new HttpRequest instance
-