# Httpget, jsonDecode and special characters

**URL:** <https://forum.inductiveautomation.com/t/httpget-jsondecode-and-special-characters/60700>\
**Category:** Ignition\
**Created:** [June 13, 2022, 4:43pm UTC](https://forum.inductiveautomation.com/t/httpget-jsondecode-and-special-characters/60700 "2022-06-13T16:43:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruno.nunes](https://avatars.discourse-cdn.com/v4/letter/b/a5b964/32.png) [@bruno.nunes](https://forum.inductiveautomation.com/u/bruno.nunes)\
**Post date:** [June 13, 2022, 4:43pm UTC](https://forum.inductiveautomation.com/t/httpget-jsondecode-and-special-characters/60700/1 "2022-06-13T16:43:04Z")

</div>

Hello,

Fighting with special characters, maybe someone can shed me some light and help me out.

Trying some APIs to get work orders from an externel software, and all looks good when trying API on Postman.

I expect results to look something like this:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/7/a78d156c37afd328c7a5037104c1b2c9415d7ad6.png)

I created a method to retried the same information:

```auto
def getWorks(code):
	#obter o token
	baseUrl = "https://xxx.xxx.xxx/api/"
	
	access_token = manwinwin.helper.getToken(baseUrl)
	
	#obter a lista das ordens de trabalho para o equipamento
	filterDict = {"State":['Scheduled','InProgress','NotPerformed'],"Item":code}
	filter = system.util.jsonEncode(filterDict)
	headerValues = {'Authorization': 'Bearer ' + access_token, "Accept": "application/json; charset=utf-8"}
	details = system.net.httpGet(baseUrl + "Works?Filter="+filter,headerValues=headerValues)
	print details
	detailsJSON = system.util.jsonDecode(details)
	return detailsJSON

```

What I get is:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/e/de6b795bd9cba5d266e6a060d6867dcc4a5263db.png)

I tried a few encode and decode but never got a satisfatory result.

Any suggestions?

Thank you.

---

<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 13, 2022, 4:45pm UTC](https://forum.inductiveautomation.com/t/httpget-jsondecode-and-special-characters/60700/2 "2022-06-13T16:45:35Z")

</div>

What version of Ignition are you using?  
`system.net.httpClient` is faster, more ergonomic, and significantly smarter in every way than the single-purpose `httpX` functions.

[https://docs.inductiveautomation.com/display/DOC81/system.net.httpClient](https://docs.inductiveautomation.com/display/DOC81/system.net.httpClient)

---

<div class="post-metadata">

**Author:** ![bruno.nunes](https://avatars.discourse-cdn.com/v4/letter/b/a5b964/32.png) [@bruno.nunes](https://forum.inductiveautomation.com/u/bruno.nunes)\
**Post date:** [June 13, 2022, 4:46pm UTC](https://forum.inductiveautomation.com/t/httpget-jsondecode-and-special-characters/60700/3 "2022-06-13T16:46:48Z")

</div>

Version: **8.1.17 (b2022051210)**

I’ll take a look at httpclient.

---

<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 13, 2022, 4:50pm UTC](https://forum.inductiveautomation.com/t/httpget-jsondecode-and-special-characters/60700/4 "2022-06-13T16:50:09Z")

</div>

Would be something like this:

```python
def getWorks(code):
	#obter o token
	baseUrl = "https://xxx.xxx.xxx/api/"
	
	access_token = manwinwin.helper.getToken(baseUrl)
	
	#obter a lista das ordens de trabalho para o equipamento
	filterDict = {"State":['Scheduled','InProgress','NotPerformed'],"Item":code}
	
	headers = {'Authorization': 'Bearer ' + access_token}
	client = system.net.httpClient()
	params = {"Filter": system.util.jsonEncode(filterDict)}
	response = client.get(baseUrl + "Works", params=params, headers=headers)
	print response
	return response.json

```

---

<div class="post-metadata">

**Author:** ![bruno.nunes](https://avatars.discourse-cdn.com/v4/letter/b/a5b964/32.png) [@bruno.nunes](https://forum.inductiveautomation.com/u/bruno.nunes)\
**Post date:** [June 13, 2022, 4:59pm UTC](https://forum.inductiveautomation.com/t/httpget-jsondecode-and-special-characters/60700/5 "2022-06-13T16:59:33Z")

</div>

> [@paul-griffith](#):
>
> ```auto
> #obter a lista das ordens de trabalho para o equipamento
> filterDict = {"State":['Scheduled','InProgress','NotPerformed'],"Item":code}
> 	
> headers = {'Authorization': 'Bearer ' + access_token}
> client = system.net.httpClient()
> params = {"Filter": system.util.jsonEncode(filterDict)}
> response = client.get(baseUrl + "Works", params=params, headers=headers)
> print response
> return response.json
> 
> ```

Thank you very much. I can now map the result with everything looking perfect.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/5/75e3c5c0f3693758c19c58e39b9785ee30d96006.png)
