Class HTTPResponse
java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.remoteviz.rendering.HTTPResponse
- All Implemented Interfaces:
Cloneable
This class encapsulates an HTTP response message.
Used in the
ServiceListener
onHTTPRequest() method.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enum for the HTTP status codes.Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
Field Summary
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a HTTP/1.1 response with "200 OK" status.HTTPResponse
(HTTPResponse obj) Copy constructor.HTTPResponse
(HTTPResponse.HTTPStatus statusCode) Creates a HTTP/1.1 response with the given status and a standard reason phrase.HTTPResponse
(HTTPResponse.HTTPStatus statusCode, String reason) Creates a HTTP/1.1 response with the given status and reason phrase.HTTPResponse
(HTTPResponse.HTTPStatus statusCode, String reason, String body) Creates a HTTP/1.1 response with the given status, reason phrase and message body data.HTTPResponse
(HTTPResponse.HTTPStatus statusCode, String reason, String body, int versionMajor, int versionMinor, HTTPHeaders headers) Creates a HTTP response with the given status, reason phrase, message body data, version and headers. -
Method Summary
Modifier and TypeMethodDescriptionclone()
getBody()
Returns the HTTP message body data (optional).long
Returns the size of the body, in bytes (Content-Length entity header)Returns HTTP headers.Returns the HTTP reason phrase.static String
Returns the standard HTTP reason phrase for a HTTP status code.Returns the HTTP status.Returns the HTTP version for incoming request (example "HTTP/1.1").int
HTTP uses a "major.minor" numbering scheme to indicate versions of the protocol.int
HTTP uses a "major.minor" numbering scheme to indicate versions of the protocol.Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
Constructor Details
-
HTTPResponse
public HTTPResponse(HTTPResponse.HTTPStatus statusCode, String reason, String body, int versionMajor, int versionMinor, HTTPHeaders headers) Creates a HTTP response with the given status, reason phrase, message body data, version and headers. -
HTTPResponse
public HTTPResponse()Creates a HTTP/1.1 response with "200 OK" status. -
HTTPResponse
Creates a HTTP/1.1 response with the given status, reason phrase and message body data. -
HTTPResponse
Copy constructor. -
HTTPResponse
Creates a HTTP/1.1 response with the given status and reason phrase. -
HTTPResponse
Creates a HTTP/1.1 response with the given status and a standard reason phrase.
-
-
Method Details
-
clone
-
getHeaders
Returns HTTP headers. -
getVersionMinor
public int getVersionMinor()HTTP uses a "major.minor" numbering scheme to indicate versions of the protocol. Returns the version minor. -
getContentLength
public long getContentLength()Returns the size of the body, in bytes (Content-Length entity header) -
getVersionMajor
public int getVersionMajor()HTTP uses a "major.minor" numbering scheme to indicate versions of the protocol. Returns the version major. -
getVersion
Returns the HTTP version for incoming request (example "HTTP/1.1"). -
getReasonPhrase
Returns the standard HTTP reason phrase for a HTTP status code. -
getStatusCode
Returns the HTTP status. -
getBody
Returns the HTTP message body data (optional). Returns an empty string if the response does not have a body message. -
getReason
Returns the HTTP reason phrase.
-