I am currently able to pull in data from the JIRA REST API using system.net.httpGet(), but when I try the same request with system.net.httpClient().get() I receive a java.io.IOException GOAWAY.
I have checked for header differences between the two calls and found none. I also tried changing the redirect_policy which led to no improvement. Is there a difference with how the Java 11 HttpClient makes the connection with the API server that differs from the old system.net.httpGet() that might lead to this issue?
httpClient is using HTTP/2, which the target server is apparently not accepting and apparently not negotiating correctly. Unfortunately, the solution (telling HttpClient to only use HTTP/1) is not currently viable due to a bug:
Until that bug is fixed, you'll likely have to keep using httpGet.
Thank you for the explanation - I’ll be looking out for an update in the future. In the meantime, is there a compatible library I could use to execute a “multipart/form-data” POST with? It’s the reason why I wanted to try using system.net.httpClient() in the first place. I don’t believe system.net.httpPost() will work.
Actually, httpClient doesn't do you any favors with multipart/form-data at present either (). I've seen customers use requests in Ignition directly; you can access pip to install it more easily using the method outlined here:
Hi @PGriffith is that [BUG-16787] still not fixed?
I’m on 8.1.17 and trying to use httpClient.post and i think i am running into the same problem in this thread.
com.inductiveautomation.ignition.common.script.JythonExecException
Traceback (most recent call last):
File "<function:runAction>", line 81, in runAction
File "<function:runAction>", line 67, in testSendMsg3
java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: java.io.IOException: Can't get stream 1: java.io.EOFException: EOF reached while reading
caused by org.python.core.PyException
Traceback (most recent call last):
File "<function:runAction>", line 81, in runAction
File "<function:runAction>", line 67, in testSendMsg3
java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: java.io.IOException: Can't get stream 1: java.io.EOFException: EOF reached while reading
caused by ExecutionException: java.io.IOException: Can't get stream 1: java.io.EOFException: EOF reached while reading
caused by IOException: Can't get stream 1: java.io.EOFException: EOF reached while reading
caused by EOFException: EOF reached while reading
Ignition v8.1.13 (b2021122109)
Java: Azul Systems, Inc. 11.0.13
My bad, i forgot what gateway i was testing this on. There are 5 gateways on this project and i updated all of them (except this one) to 8.1.17 recently.
I’ll try update it and see how we go with that new version option.
Cheers
Edit: Yep that worked fine forcing version to “HTTP_1_1”. Cheers