类 HttpRequest.Builder

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

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

    • Builder

      public Builder()
  • 方法详细资料

    • url

      public HttpRequest.Builder url(String url)
      Set the request URL.
      参数:
      url - the URL
      返回:
      this builder
    • method

      public HttpRequest.Builder method(String method)
      Set the HTTP method.
      参数:
      method - the method (GET, POST, etc.)
      返回:
      this builder
    • header

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

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

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

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