But now, if you want to send the same request to a server running on secured protocol (as HTTPS on port 443), you can’t use this method given that the request will be sent in plain text and the server won’t be able to understand it.
You will need to use the tool s_client provided with openssl. Once the tool is started, you wil immediately receive the certificate informations and will be able to send your request:
openssl s_client-connect www.python.org:443
You will immediately get the server response with the headers as previously (in my example, a 404 error is sent back due to a non-existing page requested):