# Http Post with header, body

**URL:** <https://forum.inductiveautomation.com/t/http-post-with-header-body/60895>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [June 17, 2022, 3:52pm UTC](https://forum.inductiveautomation.com/t/http-post-with-header-body/60895 "2022-06-17T15:52:49Z")\
**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:** [June 17, 2022, 4:29pm UTC](https://forum.inductiveautomation.com/t/http-post-with-header-body/60895/2 "2022-06-17T16:29:44Z")

</div>

You definitely want to use `httpClient` over `httpPost`. However, `httpClient` (currently) doesn't have special handling for POST parameters, so you'll have to manually encode, e.g. with urllib:

> [@Problems with Talk2M DMWeb API through system.net.httpClient and system.net.httpPost](https://forum.inductiveautomation.com/t/problems-with-talk2m-dmweb-api-through-system-net-httpclient-and-system-net-httppost/40441/7):
>
> Right! I forgot to encode the data object -\_- This will solve the problem when using the httpClient: import urllib data=urllib.urlencode({"t2mdevid":devId,"t2mtoken":t2mtoken}) Anyway, I can’t get the httpPost to work

---

_[View the full topic](https://forum.inductiveautomation.com/t/http-post-with-header-body/60895)._
