类 HttpResponse.Builder

java.lang.Object
io.agentscope.core.model.transport.HttpResponse.Builder
封闭类:
HttpResponse

public static class HttpResponse.Builder extends Object
Builder for HttpResponse.
  • 构造器详细资料

    • Builder

      public Builder()
  • 方法详细资料

    • statusCode

      public HttpResponse.Builder statusCode(int statusCode)
      Set the HTTP status code.
      参数:
      statusCode - the status code
      返回:
      this builder
    • header

      public HttpResponse.Builder header(String name, String value)
      Add a header to the response.
      参数:
      name - the header name
      value - the header value
      返回:
      this builder
    • headers

      public HttpResponse.Builder headers(Map<String,String> headers)
      Add multiple headers to the response.
      参数:
      headers - the headers to add
      返回:
      this builder
    • body

      public HttpResponse.Builder body(String body)
      Set the response body.
      参数:
      body - the body string
      返回:
      this builder
    • build

      public HttpResponse build()
      Build the HttpResponse.
      返回:
      a new HttpResponse instance