Package nl.colorize.util.http
Class URLResponse
java.lang.Object
nl.colorize.util.http.URLResponse
- All Implemented Interfaces:
Resource
Represents an HTTP response that is returned after sending an HTTP request
to a URL. Used in conjunction with
URLLoader
, which supports/uses
a variety of HTTP clients depending on the platform.-
Constructor Summary
ConstructorDescriptionURLResponse
(int status, Headers headers, byte[] body) URLResponse
(int status, Headers headers, String body) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getBody()
Returns the value of the HTTPContent-Type
header.Returns the value of the HTTP header with the specified name.getHeaderValues
(String name) Returns all values for the HTTP header with the specified name.int
openReader
(Charset charset) readBody()
protected void
setSslSession
(SSLSession sslSession) toString()
-
Constructor Details
-
URLResponse
-
URLResponse
-
-
Method Details
-
getHeader
Returns the value of the HTTP header with the specified name. Using this method is equivalent togetHeaders().get(name)
. -
getHeaderValues
Returns all values for the HTTP header with the specified name. Using this method is equivalent togetHeaders().getAll(name)
. -
getContentType
Returns the value of the HTTPContent-Type
header. -
openStream
- Specified by:
openStream
in interfaceResource
-
openReader
- Specified by:
openReader
in interfaceResource
-
read
-
readBody
-
toString
-
getStatus
public int getStatus() -
getHeaders
-
getBody
public byte[] getBody() -
getSslSession
-
setSslSession
-