Calling API from post save hook?

This is my config file

import requests
c = get_config() #noqa

def script_post_save(model, os_path, contents_manager, **kwargs):
x = requests.get(‘http://127.0.01:5000/ping’)

c.FileContentsManager.post_save_hook = script_post_save

The code is definitely being on file save because I’m getting an error when I save that says that it is unable to connect to the local host. I have double checked the everything is working on 5000 by hitting it from the browser. Is there something I need to open up to enable the outboud request?

Specifically, the error is connection refused

http://127.0.0.1:5000/ping still occurs when using the correct URL…

What API is that? jupyter-server does not have /ping endpoint (The REST API — Jupyter Server documentation).

I have a separate process listening on that endpoint, a different API. The request call works when called from an independent script

I figured it out, the issue was not with Jupyter, it was with the container that it was sitting in