Converting httpGet to httpClient

I'm not sure what I'm missing here while trying to convert my old httpGet() requests to the new httpClient().

Old Version

header = {'Content-Type': 'text/json','Authorization':'Bearer %s' % accessToken} 
body = '{"selection":{"selectionType":"registered","selectionMatch":"","includeRuntime":true}}' #"includeAlerts":true

url = '' % body
response =, headerValues=header)
json = system.util.jsonDecode(response)	

Attempted new version

headers = {"Content-Type": "text/json","Authorization":"Bearer %s" % accessToken} 
params = {"selection":{"selectionType":"registered","selectionMatch":"","includeRuntime":True}} #"includeAlerts":true

url = ''
response = http.client.get(url, params = params, headers=headers)
json = response.getText()
print json


  "status": {
    "code": 4,
    "message": "Serialization error. Malformed json. Check your request and parameters are valid."

I fixed it, I should have taken out the & between format and body and added to the dictionary and not the url. This fixed it :slight_smile:

params = {"format":"json","body":{"selection":{"selectionType":"registered","selectionMatch":"","includeRuntime":"true"}}} #"includeAlerts":true

url = ''
1 Like