Hey all, I am trying to create a work pool using r...
# ask-community
n
Hey all, I am trying to create a work pool using requests library in Python and prefect api. The URL is HTTPS, and the get request works as expected, yet the post request refuses to do it over the HTTP and redirects to HTTP, which is not open, and I get the ConnectionError. Also when I manually create the work pool in UI, patch request works to update the job template. I am using basic auth in prefect directly. Here is the full command:
requests.post(url='<https://staging.prefect.domain.com/api/work_pools>', json=work_pool_data, auth=HTTPBasicAuth(basic_auth_username, basic_auth_password))
From which I get:
requests.exceptions.ConnectionError: HTTPConnectionPool(host='<http://staging.prefect.domain.com|staging.prefect.domain.com>', port=80): Max retries exceeded with url: /api/work_pools/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5f77632c00>: Failed to establish a new connection: [Errno 111] Connection refused'))
Any ideas why does post request not process over https and redirects to http?