# system.net.httpPost()

**URL:** <https://forum.inductiveautomation.com/t/system-net-httppost/31635>\
**Category:** Ignition\
**Created:** [January 27, 2020, 6:57am UTC](https://forum.inductiveautomation.com/t/system-net-httppost/31635 "2020-01-27T06:57:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashwin.m](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@ashwin.m](https://forum.inductiveautomation.com/u/ashwin.m)\
**Post date:** [January 27, 2020, 6:57am UTC](https://forum.inductiveautomation.com/t/system-net-httppost/31635/1 "2020-01-27T06:57:07Z")

</div>

How do i pass parameters and header to an url using system.net.httpPost() function.

 ![httpPost](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/587183301b515c0a4225767761e6d8df72c76fb1.png)

---

<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:** [January 27, 2020, 4:44pm UTC](https://forum.inductiveautomation.com/t/system-net-httppost/31635/2 "2020-01-27T16:44:47Z")

</div>

If you’re on a recent 8.0 version, you can use [system.net.httpClient()](https://docs.inductiveautomation.com/display/DOC80/system.net.httpClient):  
`system.net.httpClient().post(url=url, params=parameters, headers=header).json`

That said, using `system.net.httpPost` should still work, but you’ll have to encode your URL parameters manually; the `postData` parameter the function accepts indicates data to send _in the request body_, not as URL parameters, which it looks like you’re trying to do. You’ll need to manually append the parameters to the API URL you’re retrieving; something like:

```auto
import urllib

url = "http://192.168.1.598/api"
url += "?"
postParams = # some dictionary
header = #some dictionary

for k, v in postParams.items():
	url += urllib.quote(k) + "=" + urllib.quote(v)

system.net.httpPost(url, headerValues=header)

```

---

<div class="post-metadata">

**Author:** ![ashwin.m](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@ashwin.m](https://forum.inductiveautomation.com/u/ashwin.m)\
**Post date:** [January 28, 2020, 4:00am UTC](https://forum.inductiveautomation.com/t/system-net-httppost/31635/3 "2020-01-28T04:00:02Z")

</div>

Yes i actually did not define the parameters for system.net.httpPost() as defined.  
Now its working fine.  
I ll also try system.net.httpClient().  
Thanks for the help
