Hi Admin,
I’m a new python user, my python version is 3.6.5. I tried to retrieve the access token using Python based on the codes found in thread below.
When i tried to run the codes
import http.client
conn = http.client.HTTPSConnection(“developers.onemap.sg”)
payload = “------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=“email”\r\n\r\ndemo@onemap.sg\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=“password”\r\n\r\ndemo123!\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW–”
headers = {
‘content-type’: “multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW”,
‘cache-control’: “no-cache”
}
conn.request(“POST”, “/privateapi/auth/post/getToken”, payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode(“utf-8”))
Python hit an error at line 3…
File “”, line 3
conn = http.client.HTTPSConnection(“developers.onemap.sg”)
^
SyntaxError: invalid character in identifier
Appreciate your guidance please.