1

I have a python file which need to make a POST call.

import requests

url = "https://some.website.com/uploadimage"
post_data = {'timestamp':timestamp,'binaryData':data}

res = requests.post(url, data=post_data, headers={'Content-Type': 'application/json'})

I get the following error.

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 588, in urlopen
    conn = self._get_conn(timeout=pool_timeout)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 248, in _get_conn
    return conn or self._new_conn()
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 818, in _new_conn
    raise SSLError("Can't connect to HTTPS URL because the SSL "
urllib3.exceptions.SSLError: Can't connect to HTTPS URL because the SSL module is not available.

I have the sys as below

import sys
sys.path.append('/usr/lib/python3/dist-packages')
Leons
  • 201
  • 1
  • 7

0 Answers0