类 HttpResponse
java.lang.Object
io.agentscope.core.model.transport.HttpResponse
HTTP response encapsulation for the transport layer.
This class represents an HTTP response with status code, headers, and body.
-
嵌套类概要
嵌套类 -
方法概要
修饰符和类型方法说明static HttpResponse.Builderbuilder()Create a new builder for HttpResponse.getBody()Get the response body.Get the response headers.intGet the HTTP status code.booleanCheck if the response indicates success (2xx status code).
-
方法详细资料
-
getStatusCode
public int getStatusCode()Get the HTTP status code.- 返回:
- the status code
-
getHeaders
Get the response headers.- 返回:
- an unmodifiable map of headers
-
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
Create a new builder for HttpResponse.- 返回:
- a new Builder instance
-