Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions openam.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
__version__ = '1.1.0'

import urllib
import urllib2
import urllib.request as urllib2
import json
import urlparse
import urllib.parse as urlparse

# REST API URIs
REST_OPENAM_LOGIN = '/identity/json/authenticate'
Expand Down Expand Up @@ -294,9 +294,10 @@ def http_get(url, data, timeout):
Send a simple HTTP GET and attempt to return the response data.
"""

params = urllib.urlencode(data)
params = urllib.parse.urlencode(data).encode("utf-8")
try:
resp = urllib2.urlopen(url, data=params, timeout=timeout)
req = urllib2.Request(url)
resp = urllib2.urlopen(req, data=params, timeout=timeout)
except urllib2.HTTPError:
return ''

Expand Down