# httpPut json payload escaping

**URL:** <https://forum.inductiveautomation.com/t/httpput-json-payload-escaping/73814>\
**Category:** Ignition\
**Created:** [May 16, 2023, 9:46pm UTC](https://forum.inductiveautomation.com/t/httpput-json-payload-escaping/73814 "2023-05-16T21:46:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wpmccormick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wpmccormick/32/13940_2.png) [@wpmccormick](https://forum.inductiveautomation.com/u/wpmccormick)\
**Post date:** [May 16, 2023, 9:46pm UTC](https://forum.inductiveautomation.com/t/httpput-json-payload-escaping/73814/1 "2023-05-16T21:46:28Z")

</div>

I'm having an issue making a simple json payload work for an API.

This curl works:

> curl -X PUT "[http://lac-00-0060/control/v1/jobs/6bdd1116-3c07-445d-a158-0a2aec6dbb6a](http://lac-00-0060/control/v1/jobs/6bdd1116-3c07-445d-a158-0a2aec6dbb6a)" -H "accept: application/json" -H "Content-type: application/json" -d "{\"selected\":true}"

... and yes, if I remove the escaped quotes, the API tells me:

> {  
> "detail": "Request body is not valid JSON",  
> "status": 400,  
> "title": "Bad Request",  
> "type": "about:blank"  
> }

... which is what I get from Ignition no matter how I build the payload:

> params = {'\"selected\"': "false"}  
> or  
> params = {"\\\"selected\\\"": "false"}

Why is this not working?

Short of Wireshark, is there some way to inspect what is actually output?

Cheers!

---

<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:** [May 16, 2023, 9:47pm UTC](https://forum.inductiveautomation.com/t/httpput-json-payload-escaping/73814/2 "2023-05-16T21:47:46Z")

</div>

Don't use `httpPut`. Use `httpClient`. There are numerous problems with the legacy functions.

Meanwhile, don't try to force the quotes in the dictionary that will become json, and don't supply strings for booleans. Let Ignition's json-encoder handle such things. So:

```auto
params = {"selected": False}

```

Note the use of **jython's** boolean.
