Challenge: Check Website Web Protocol
Swipe to start coding
Let's create a simple function that will make a basic request to a website and check whether it uses HTTPS.
Your task is to:
- Make a request and check if the response status code equals
200
. It's needed to check the availability of the chosen URL. - Check if the response URL starts with subscring
https
. It will indicate that our source uses HTTPS web protocol. - Call the
check_https_protocol()
function with the corresponding URL as an argument to check it.
Note
While our URL (
'http://codefinity.com'
) initially indicates the use of the HTTP protocol, the server might redirect it to HTTPS as per its server-side configurations. We aim to ascertain the server's support for HTTPS by examining its configurations. If successful, our request will be redirected, and the response URL will commence with'https'
.
Solución
¡Gracias por tus comentarios!
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
Resumir este capítulo
Explicar el código en file
Explicar por qué file no resuelve la tarea
Awesome!
Completion rate improved to 5
Challenge: Check Website Web Protocol
Desliza para mostrar el menú
Swipe to start coding
Let's create a simple function that will make a basic request to a website and check whether it uses HTTPS.
Your task is to:
- Make a request and check if the response status code equals
200
. It's needed to check the availability of the chosen URL. - Check if the response URL starts with subscring
https
. It will indicate that our source uses HTTPS web protocol. - Call the
check_https_protocol()
function with the corresponding URL as an argument to check it.
Note
While our URL (
'http://codefinity.com'
) initially indicates the use of the HTTP protocol, the server might redirect it to HTTPS as per its server-side configurations. We aim to ascertain the server's support for HTTPS by examining its configurations. If successful, our request will be redirected, and the response URL will commence with'https'
.
Solución
¡Gracias por tus comentarios!
Awesome!
Completion rate improved to 5single