Why is this request not getting to the server even if the request is started?

I am trying to get a simple response from a server to check if it is online or not. I have two functions, the first one:


is making the request to the server. It prints request processed, so at least it sarts the request, but then I don’t get any more prints and in the server they don’t get any health requests. I add as well the response callback just in case something is wrong with it

Both functions were done follwoing this post, so I don’t know if something that I am using is deprecated or it is that I am not understanding something.