Package ai.preferred.venom.response
Class VResponse
- java.lang.Object
-
- ai.preferred.venom.response.VResponse
-
- All Implemented Interfaces:
Response
,Unwrappable
public class VResponse extends java.lang.Object implements Response, Unwrappable
- Author:
- Maksim Tkachenko, Truong Quoc Tuan, Ween Jiann Lee
-
-
Field Summary
Fields Modifier and Type Field Description static java.nio.charset.Charset
DEFAULT_CHARSET
The default charset to be used to decode response.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getBaseUrl()
Returns the base form of the url used in this request.byte[]
getContent()
Returns raw content of the response.org.apache.http.entity.ContentType
getContentType()
Returns the content type of the content fetched.org.apache.http.Header[]
getHeaders()
Returns the headers that were used to trigger this response.java.lang.String
getHtml()
Returns the html in string format.java.lang.String
getHtml(java.nio.charset.Charset charset)
Returns the html in string format.Response
getInner()
Returns the unwrapped version of this request.org.jsoup.nodes.Document
getJsoup()
Returns a Joup document of this response.org.jsoup.nodes.Document
getJsoup(java.nio.charset.Charset charset)
Returns a Jsoup document of this response.org.apache.http.HttpHost
getProxy()
Returns the proxy that was used to trigger this response.int
getStatusCode()
Returns status code of the response.
-
-
-
Constructor Detail
-
VResponse
public VResponse(Response response)
Constructs a VResponse.- Parameters:
response
- An instance of response
-
-
Method Detail
-
getStatusCode
public final int getStatusCode()
Description copied from interface:Response
Returns status code of the response.- Specified by:
getStatusCode
in interfaceResponse
- Returns:
- int code
-
getContent
public final byte[] getContent()
Description copied from interface:Response
Returns raw content of the response.- Specified by:
getContent
in interfaceResponse
- Returns:
- byte[] content
-
getContentType
public final org.apache.http.entity.ContentType getContentType()
Description copied from interface:Response
Returns the content type of the content fetched.This is provided by the server or guessed by the server or an amalgamation of both.
- Specified by:
getContentType
in interfaceResponse
- Returns:
- an instance of ContentType
-
getHeaders
public final org.apache.http.Header[] getHeaders()
Description copied from interface:Response
Returns the headers that were used to trigger this response.- Specified by:
getHeaders
in interfaceResponse
- Returns:
- an array of headers
-
getBaseUrl
public final java.lang.String getBaseUrl()
Description copied from interface:Response
Returns the base form of the url used in this request.- Specified by:
getBaseUrl
in interfaceResponse
- Returns:
- stripped down version of requested url
-
getProxy
public final org.apache.http.HttpHost getProxy()
Description copied from interface:Response
Returns the proxy that was used to trigger this response.
-
getHtml
public final java.lang.String getHtml()
Returns the html in string format.- Returns:
- string of html response
-
getHtml
public final java.lang.String getHtml(java.nio.charset.Charset charset)
Returns the html in string format.- Parameters:
charset
- use specified charset for this html document- Returns:
- string of html response
-
getJsoup
public final org.jsoup.nodes.Document getJsoup()
Returns a Joup document of this response.- Returns:
- Jsoup document of response
-
getJsoup
public final org.jsoup.nodes.Document getJsoup(java.nio.charset.Charset charset)
Returns a Jsoup document of this response.- Parameters:
charset
- use specified charset for this html document- Returns:
- Jsoup document of response
-
getInner
public final Response getInner()
Description copied from interface:Unwrappable
Returns the unwrapped version of this request.- Specified by:
getInner
in interfaceUnwrappable
- Returns:
- an instance of request
-
-