# Migrating From httpPost to httpClient...HELP!

**URL:** <https://forum.inductiveautomation.com/t/migrating-from-httppost-to-httpclient-help/117020>\
**Category:** Ignition\
**Created:** [September 8, 2026, 7:05pm UTC](https://forum.inductiveautomation.com/t/migrating-from-httppost-to-httpclient-help/117020 "2026-09-08T19:05:08Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![erfritts](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/erfritts/32/3660_2.png) [@erfritts](https://forum.inductiveautomation.com/u/erfritts)\
**Post date:** [September 8, 2026, 7:05pm UTC](https://forum.inductiveautomation.com/t/migrating-from-httppost-to-httpclient-help/117020/1 "2026-09-08T19:05:08Z")

</div>

I love my well used result = system.net.httpPost(url, params). I insert my API url and dictionary of parameters then decode the beautiful json that gets returned. Now I have to update all our legacy code and this httpClient is not making me happy! So I am getting back a 200 with the new code. The funny thing is it is not populating the $\_POST variables on the server. I do not believe it is being redirected because if I put params=payload it populates $\_GET. data=payload populates nothing.

below are examples of my feeble attempts.

```python
response = system.net.httpClient.request(url=posturl, method="POST", data=payload)

response = system.net.httpClient.post(url, data=payload)

```

I humbly request someone tell me what I am doing wrong. Thank you.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 8, 2026, 7:28pm UTC](https://forum.inductiveautomation.com/t/migrating-from-httppost-to-httpclient-help/117020/2 "2026-09-08T19:28:15Z")

</div>

What's in the `payload` variable? Is this HTTP or HTTPS?

---

<div class="post-metadata">

**Author:** ![erfritts](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/erfritts/32/3660_2.png) [@erfritts](https://forum.inductiveautomation.com/u/erfritts)\
**Post date:** [September 8, 2026, 7:31pm UTC](https://forum.inductiveautomation.com/t/migrating-from-httppost-to-httpclient-help/117020/3 "2026-09-08T19:31:32Z")

</div>

we are using HTTP.

---

<div class="post-metadata">

**Author:** ![erfritts](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/erfritts/32/3660_2.png) [@erfritts](https://forum.inductiveautomation.com/u/erfritts)\
**Post date:** [September 8, 2026, 7:34pm UTC](https://forum.inductiveautomation.com/t/migrating-from-httppost-to-httpclient-help/117020/4 "2026-09-08T19:34:01Z")

</div>

I think I can give you this without causing any hoopla

```python
    def postShowSafetyAssets(self):
        window = system.vision.getWindow('Safety')
        lbl = window.rootContainer.getComponent('lblCurrentAction')
        buttons = [window.rootContainer.getComponent("btnRequest" + str(i)) for i in range(1,25)]
        posttags = ["[default]HttpRequest/Weld/urlsafety", "[default]HttpRequest/key"]
        postvals = system.tag.readBlocking(posttags)
        dict = {"k":postvals[1].value, "w":"AB", "l":"ABB Welder", "t":"welder"}
        result = system.net.httpPost(postvals[0].value, dict)
        if result!="":
            string = system.util.jsonDecode(result)
            if string['status']=="OK":
                if "items" in string:
                    message = string["subtitle"]
                    items = string["items"]
                    for item, button in zip(items, buttons):
                        button.text = item["name"]
                else:
                    pass 
                lbl.text = message

```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 8, 2026, 7:41pm UTC](https://forum.inductiveautomation.com/t/migrating-from-httppost-to-httpclient-help/117020/5 "2026-09-08T19:41:27Z")

</div>

If you're using HTTP you can look at Wireshark and try to spot the difference between system.net.httpPost and system.net.httpClient.

---

<div class="post-metadata">

**Author:** ![erfritts](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/erfritts/32/3660_2.png) [@erfritts](https://forum.inductiveautomation.com/u/erfritts)\
**Post date:** [September 8, 2026, 7:46pm UTC](https://forum.inductiveautomation.com/t/migrating-from-httppost-to-httpclient-help/117020/6 "2026-09-08T19:46:54Z")

</div>

The corporate overlords recently pwned my machine so now I can't put whatever I want on here. Could an old PHP setup be the problem? our server is only 5.3.3

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 8, 2026, 7:48pm UTC](https://forum.inductiveautomation.com/t/migrating-from-httppost-to-httpclient-help/117020/7 "2026-09-08T19:48:56Z")

</div>

I don't know a thing about PHP.

Talk to IT and get access to the tools you need to do your job.

---

<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:** [September 8, 2026, 9:14pm UTC](https://forum.inductiveautomation.com/t/migrating-from-httppost-to-httpclient-help/117020/8 "2026-09-08T21:14:55Z")

</div>

Educated guess, try setting an explicit HTTP version of 1.1 when using `httpClient`.

Untested (obviously) adjusted code with no other significant changes:

```python
def postShowSafetyAssets(self):
	window = system.vision.getWindow('Safety')
	lbl = window.rootContainer.getComponent('lblCurrentAction')
	buttons = [window.rootContainer.getComponent("btnRequest" + str(i)) for i in range(1,25)]
	posttags = ["[default]HttpRequest/Weld/urlsafety", "[default]HttpRequest/key"]
	postvals = system.tag.readBlocking(posttags)
	data = {"k":postvals[1].value, "w":"AB", "l":"ABB Welder", "t":"welder"}
	result = system.net.httpClient(version="HTTP_1_1").post(postvals[0].value, data)
	if result.good:
		if result.json['status']=="OK":
			if "items" in result.json:
				message = result.json["subtitle"]
				items = result.json["items"]
				for item, button in zip(items, buttons):
					button.text = item["name"]
			else:
				pass 
			lbl.text = message

```

If this works you really want to instantiate your http client in a project library script somewhere so you're not creating a whole new http client every time you click a button.

* * *

As an aside, there's zero reason for urgency in migrating away from `httpPost` in the first place.  
When we deprecate scripting functions, we hide them to discourage new code from using them, but with _extremely_ rare exceptions, we keep them working, with the same signature, ~forever.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 8, 2026, 10:14pm UTC](https://forum.inductiveautomation.com/t/migrating-from-httppost-to-httpclient-help/117020/9 "2026-09-08T22:14:26Z")

</div>

> [@paul-griffith](#):
>
> not creating a whole new http client every time you click a button

Hey Paul, I thought this was "fixed" recently, in that we didn't need to worry about creating an http client within a module variable anymore, as you do it under the hood? Or did I misunderstand?

---

<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:** [September 8, 2026, 10:19pm UTC](https://forum.inductiveautomation.com/t/migrating-from-httppost-to-httpclient-help/117020/10 "2026-09-08T22:19:18Z")

</div>

The change in 8.3 is that `system.net.httpClient` is auto-magically both an _instance_ of the HTTP client (created with all default settings) _and_ the factory function for new instances.

So you if you were _previously_ running `system.net.httpClient().doSomething()`, you can swap that to `system.net.httpClient.doSomething()` and it'll work exactly the same, but is guaranteed to re-use the same lazily created HTTP client instance.

However, if you have to _customize_ the creation of the http client in any way, the same don't-create-a-million-instances rules apply.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 8, 2026, 10:19pm UTC](https://forum.inductiveautomation.com/t/migrating-from-httppost-to-httpclient-help/117020/11 "2026-09-08T22:19:51Z")

</div>

Take a very close look at the caution at the top of the docs for [system.net.httpClient](https://www.docs.inductiveautomation.com/docs/8.3/appendix/scripting-functions/system-net/system-net-httpClient).

Edit: Paul was faster.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 8, 2026, 10:25pm UTC](https://forum.inductiveautomation.com/t/migrating-from-httppost-to-httpclient-help/117020/12 "2026-09-08T22:25:09Z")

</div>

Ok, that makes sense. So the reason in this case to create as a module var is the version customisation, gotcha 👍

I also should have checked the manual first, I didn't know it had been updated

---

<div class="post-metadata">

**Author:** ![erfritts](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/erfritts/32/3660_2.png) [@erfritts](https://forum.inductiveautomation.com/u/erfritts)\
**Post date:** [September 9, 2026, 2:44pm UTC](https://forum.inductiveautomation.com/t/migrating-from-httppost-to-httpclient-help/117020/13 "2026-09-09T14:44:47Z")

</div>

Thank you for your answer Paul. Tried your little solution to no avail. In fact the request is denied completely. I am fairly positive this is an issue of the API server needing to be given a drastic upgrade. Fight for another day. I will make comments in the code about the future deprecation and drive on updating the rest.
