1515ssid = os .getenv ("CIRCUITPY_WIFI_SSID" )
1616password = os .getenv ("CIRCUITPY_WIFI_PASSWORD" )
1717
18- JSON_GET_URL = "https://httpbin.org/get"
19- STATUS_TEST = "https://httpbin.org/status/"
20-
2118# Initalize Wifi, Socket Pool, Request Session
2219pool = adafruit_connection_manager .get_radio_socketpool (wifi .radio )
2320ssl_context = adafruit_connection_manager .get_radio_ssl_context (wifi .radio )
@@ -104,6 +101,8 @@ def print_http_status(code, description):
104101 "511" : "Network Authentication Required" ,
105102}
106103
104+ JSON_GET_URL = "https://httpbin.org/get"
105+ STATUS_TEST = "https://httpbin.org/status/"
107106
108107print (f"\n Connecting to { ssid } ..." )
109108print (f"Signal Strength: { rssi } " )
@@ -114,8 +113,6 @@ def print_http_status(code, description):
114113 print (f"❌ OSError: { e } " )
115114print ("✅ Wifi!" )
116115
117- JSON_GET_URL = "https://httpbin.org/get"
118-
119116# Define a custom header as a dict.
120117HEADERS = {"user-agent" : "blinka/1.0.0" }
121118
@@ -134,8 +131,8 @@ def print_http_status(code, description):
134131response .close ()
135132print (f" | ✂️ Disconnected from { JSON_GET_URL } " )
136133print (" | " )
137- print (f" | Status Code Test: { JSON_GET_URL } " )
138134
135+ print (f" | Status Code Test: { STATUS_TEST } " )
139136# Some return errors then confirm the error (that's a good thing)
140137# Demonstrates not all errors have the same behavior
141138# 300, 304, and 306 in particular
0 commit comments