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