Class JythonHttpClient
java.lang.Object
com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient
A modern, non-blocking HTTP client for use in scripting (system.net.httpClient).
Wraps the Java 11+ HttpClient, optimized for use from Jython.
-
Method Summary
Modifier and TypeMethodDescriptionstatic JythonHttpClientbuildHttpClient(org.python.core.PyObject[] pyArgs, String[] keywords, PromiseExecutor executor) deleteAsync(org.python.core.PyObject[] pyArgs, String[] keywords) Performs a synchronous HTTP GET request.Performs an asynchronous HTTP GET request.longcom.inductiveautomation.ignition.common.gson.GsongetGson()optionsAsync(org.python.core.PyObject[] pyArgs, String[] keywords) parseCharset(String contentType) patchAsync(org.python.core.PyObject[] pyArgs, String[] keywords) Performs a synchronous HTTP POST request.requestAsync(org.python.core.PyObject[] pyArgs, String[] keywords) voidsetGson(com.inductiveautomation.ignition.common.gson.Gson gson) toString()traceAsync(org.python.core.PyObject[] pyArgs, String[] keywords)
-
Method Details
-
parseCharset
public static Optional<Charset> parseCharset(String contentType) throws org.python.core.PyIgnoreMethodTag - Throws:
org.python.core.PyIgnoreMethodTag
-
head
- Throws:
IOException
-
headAsync
-
get
Performs a synchronous HTTP GET request.Example:
client = system.net.httpClient() response = client.get("https://httpbin.org/get", params={"a": 1}) if response.good: print response.json- Parameters:
pyArgs- The keyword arguments: 'url', 'params', 'headers', etc.keywords- The keyword names.- Returns:
- A
Responseobject. - Throws:
IOException- If an I/O error occurs.
-
getAsync
Performs an asynchronous HTTP GET request. -
post
Performs a synchronous HTTP POST request.- Parameters:
pyArgs- The keyword arguments: 'url', 'data', 'headers', etc.keywords- The keyword names.- Returns:
- A
Responseobject. - Throws:
IOException- If an I/O error occurs.
-
postAsync
-
put
- Throws:
IOException
-
putAsync
-
patch
- Throws:
IOException
-
patchAsync
-
delete
- Throws:
IOException
-
deleteAsync
-
trace
- Throws:
IOException
-
traceAsync
-
options
- Throws:
IOException
-
optionsAsync
-
request
- Throws:
IOException
-
requestAsync
-
__call__
public JythonHttpClient __call__(org.python.core.PyObject[] pyArgs, String[] keywords) throws Exception - Throws:
Exception
-
getCookieManager
-
getGson
public com.inductiveautomation.ignition.common.gson.Gson getGson() -
setGson
public void setGson(com.inductiveautomation.ignition.common.gson.Gson gson) -
getConnectTimeout
public long getConnectTimeout() -
getRedirectPolicy
-
getVersion
-
getJavaClient
-
toString
-
buildHttpClient
public static JythonHttpClient buildHttpClient(org.python.core.PyObject[] pyArgs, String[] keywords, PromiseExecutor executor) throws Exception, org.python.core.PyIgnoreMethodTag - Throws:
Exceptionorg.python.core.PyIgnoreMethodTag
-