# system.net.httpClient() causes java.io.IOException while system.net.httpGet() works fine

**URL:** <https://forum.inductiveautomation.com/t/system-net-httpclient-causes-java-io-ioexception-while-system-net-httpget-works-fine/45547>\
**Category:** Ignition\
**Tags:** ignition80, scripting\
**Created:** [April 13, 2021, 7:09pm UTC](https://forum.inductiveautomation.com/t/system-net-httpclient-causes-java-io-ioexception-while-system-net-httpget-works-fine/45547 "2021-04-13T19:09:31Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 13, 2021, 8:31pm UTC](https://forum.inductiveautomation.com/t/system-net-httpclient-causes-java-io-ioexception-while-system-net-httpget-works-fine/45547/2 "2021-04-13T20:31:57Z")

</div>

`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:

> [@\[BUG-16787\] system.net.httpClient() HttpClient.Version customizer](http://forum.inductiveautomation.com/t/bug-16787-system-net-httpclient-httpclient-version-customizer/39138):
>
> I need to set my http clients version, similar to: HttpClient.newBuilder() .version(Version.HTTP\_1\_1) so I defined a customizer function to set it, but I cannot for the life of me figure out what I need to import or define so that I can specify the version parameter needed in the .version method. Here is my callable, but I just cant seem to figure it out. def clientCustomizer(client): return client.version(HttpClient.Version.versionOf("HTTP\_1\_1")) If anyone has any ideas they are great…

Until that bug is fixed, you'll likely have to keep using `httpGet`.

---

_[View the full topic](https://forum.inductiveautomation.com/t/system-net-httpclient-causes-java-io-ioexception-while-system-net-httpget-works-fine/45547)._
