Created
May 30, 2024 15:02
-
-
Save goatgoose/8bc68f2ec9f61fd5308eeabfb0cc42ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_get_request(route, host, user_agent): | |
return f"GET {route} HTTP/1.1\r\nHost: {host}\r\nUser-Agent: {user_agent}\r\n\r\n" | |
with open("http_request", "w") as http_request_file: | |
http_request_file.write(create_get_request( | |
"/points/39.7456,-97.0892", | |
"api.weather.gov", | |
"test-agent" | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment