java.lang.Object
org.miaixz.bus.http.metric.http.StatusLine
Represents the status line of an HTTP response, such as "HTTP/1.1 200 OK".
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStatusLine(org.miaixz.bus.core.net.Protocol protocol, int code, String message) -
Method Summary
Modifier and TypeMethodDescriptionstatic StatusLineCreates aStatusLinefrom aResponse.static StatusLineParses a status line from a string.toString()
-
Field Details
-
protocol
public final org.miaixz.bus.core.net.Protocol protocolThe HTTP protocol, such asProtocol.HTTP_1_1. -
code
public final int codeThe HTTP status code, such as 200. -
message
The HTTP status message, such as "OK".
-
-
Constructor Details
-
StatusLine
-
-
Method Details
-
get
Creates aStatusLinefrom aResponse.- Parameters:
response- The response to extract the status line from.- Returns:
- A new
StatusLineinstance.
-
parse
Parses a status line from a string.- Parameters:
statusLine- The status line string.- Returns:
- A new
StatusLineinstance. - Throws:
IOException- if the status line is malformed.
-
toString
-