I have a URL, a JSON string, and a desire to post that JSON string to that URL with MIME type application/JSON. So I do this:
system.net.httpPost(url, "application/json",system.util.jsonEncode(payload))
where payload is the python dictionary, and url is the post URL. I’ve tried this in the script console, a version of it in Postman, and both work fine. However, it doesn’t work when I put it in a gateway timer script. I get an error like this
com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 41, in IOError: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
where line 41 is the httpPost() line above.
Googling hasn’t really gotten me anywhere; anyone know whats going on here? Also, I’m on 7.9 (with no 8.0 in sight just yet) so I can’t use the fancy new httpClient()
Edit: if it matters, it is an HTTPS url. I don’t believe there are any authentication requirements; I posted just fine without any on the script console & Postman.