Package com.couchbase.client.java.http
Class HttpResponse
- java.lang.Object
-
- com.couchbase.client.java.http.HttpResponse
-
public class HttpResponse extends Object
HTTP status code and response content.
-
-
Constructor Summary
Constructors Constructor Description HttpResponse(int statusCode, byte[] content)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
content()
Returns the content of the HTTP response.String
contentAsString()
Returns the content of the HTTP response interpreted as a UTF-8 string.int
statusCode()
Returns the HTTP status code returned by Couchbase Server.boolean
success()
Returns true if the status code is 2xx, otherwise false.String
toString()
-
-
-
Constructor Detail
-
HttpResponse
@Internal public HttpResponse(int statusCode, byte[] content)
-
-
Method Detail
-
statusCode
public int statusCode()
Returns the HTTP status code returned by Couchbase Server.
-
content
public byte[] content()
Returns the content of the HTTP response.- Returns:
- a non-null (but maybe empty) byte array.
-
contentAsString
public String contentAsString()
Returns the content of the HTTP response interpreted as a UTF-8 string.
-
success
public boolean success()
Returns true if the status code is 2xx, otherwise false.
-
-