类 HttpResponse

java.lang.Object
io.agentscope.core.model.transport.HttpResponse

public class HttpResponse extends Object
HTTP response encapsulation for the transport layer.

This class represents an HTTP response with status code, headers, and body.

  • 方法详细资料

    • getStatusCode

      public int getStatusCode()
      Get the HTTP status code.
      返回:
      the status code
    • getHeaders

      public Map<String,String> getHeaders()
      Get the response headers.
      返回:
      an unmodifiable map of headers
    • getBody

      public String getBody()
      Get the response body.
      返回:
      the body string, or null if no body
    • isSuccessful

      public boolean isSuccessful()
      Check if the response indicates success (2xx status code).
      返回:
      true if status code is 2xx
    • builder

      public static HttpResponse.Builder builder()
      Create a new builder for HttpResponse.
      返回:
      a new Builder instance