Im new to server side code and interested in using the neutrinoapi (www.neutrinoapi.com) for filtering some bad words out of text. I have written the following code in Python 3 (im using bottle server):
url = 'https://neutrinoapi.com/bad-word-filter'
params = {
'user-id': 'testing',
'api-key': '205cmqorLBdyV2F9FX4z6NNq1Y3z8AkRTw8ImtGE2MtzxmhT',
'ip': '162.209.104.195'
}
json_data = json.dumps(params).encode('utf8')
response = urllib.request.urlopen(url, data = json_data)
result = json.loads(response.read())
This request is returning the following error:
raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 403: Forbidden
The example on the website is at this link: https://www.neutrinoapi.com/api/api-examples/python/
Examples provided are using python 2.7 and urllib2 which i understand is now built into urllib. Cant seem to get the request to work in Python 3. Any ideas on how to make a proper request?