Class Response
- java.lang.Object
- 
- com.inductiveautomation.ignition.common.script.builtin.http.Response
 
- 
 public class Response extends java.lang.ObjectA thin wrapper around theHttpResponseclass. Will only ever directly contain aHttpResponse<byte[]>- is not truly generic.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classResponse.RequestWrapper
 - 
Constructor SummaryConstructors Constructor Description Response(java.net.http.HttpResponse<byte[]> httpResponse, JythonHttpClient client)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getBody()java.net.CookieManagergetCookieManager()java.util.Map<java.lang.String,java.util.List<java.lang.String>>getHeaders()java.net.http.HttpResponse<byte[]>getJavaResponse()org.python.core.PyObjectgetJson()org.python.core.PyObjectgetJson(org.python.core.PyObject[] args, java.lang.String[] kwargs)Attempt to decode the rawbyte[]this Response contains to a string with the specified charset, and then decode that string to a direct Python representation (ie, dictionaries and lists).Response.RequestWrappergetRequest()intgetStatusCode()java.lang.StringgetText()java.lang.StringgetText(org.python.core.PyObject[] args, java.lang.String[] kwargs)Attempt to decode the rawbyte[]this Response contains to a string with the specified charset.java.lang.StringgetUrl()booleanisClientError()booleanisGood()booleanisServerError()java.lang.StringtoString()
 
- 
- 
- 
Constructor Detail- 
Responsepublic Response(java.net.http.HttpResponse<byte[]> httpResponse, JythonHttpClient client)
 
- 
 - 
Method Detail- 
getBodypublic byte[] getBody() 
 - 
getJsonpublic org.python.core.PyObject getJson() 
 - 
getJson@Nonnull public org.python.core.PyObject getJson(org.python.core.PyObject[] args, java.lang.String[] kwargs)Attempt to decode the rawbyte[]this Response contains to a string with the specified charset, and then decode that string to a direct Python representation (ie, dictionaries and lists). Encoding defaults to the charset specified in the response, orStandardCharsets.UTF_8if the response did not specify a charset.
 - 
getTextpublic java.lang.String getText() 
 - 
getText@Nonnull public java.lang.String getText(org.python.core.PyObject[] args, java.lang.String[] kwargs)Attempt to decode the rawbyte[]this Response contains to a string with the specified charset. Caches decoded bodies so they can be quickly retrieved again, per charset. Encoding defaults to the charset specified in the response, orStandardCharsets.UTF_8if the response did not specify a charset.
 - 
getUrlpublic java.lang.String getUrl() 
 - 
getHeaderspublic java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaders() 
 - 
getStatusCodepublic int getStatusCode() 
 - 
isGoodpublic boolean isGood() - Returns:
- true if the response code was not any error.
 
 - 
isClientErrorpublic boolean isClientError() - Returns:
- true if the response code was a 4XX error.
 
 - 
isServerErrorpublic boolean isServerError() - Returns:
- true if the response code was a 5XX error.
 
 - 
getCookieManagerpublic java.net.CookieManager getCookieManager() 
 - 
getJavaResponsepublic java.net.http.HttpResponse<byte[]> getJavaResponse() 
 - 
getRequestpublic Response.RequestWrapper getRequest() 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-