Skip to content

Commit

Permalink
Updated the file
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Nov 13, 2024
1 parent 2c57dcb commit 1ec7c0c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions 0x11-python-network_1/1-hbtn_header.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/python3
"""a Python script that takes in a URL,
sends a request to the URL and
displays the value of the variable `X-Request-Id` in the response header"""
"""Displays the X-Request-Id header variable of a request to a given URL.
Usage: ./1-hbtn_header.py <URL>
"""
import sys
import urllib.request


if __name__ == "__main__":
url = sys.argv[1]

request = urllib.request.Request(url)

with urllib.request.urlopen(request) as response:
print(dict(response.headers).get("X-Request-Id"))
print(dict(response.headers).get("X-Request-Id"))

0 comments on commit 1ec7c0c

Please sign in to comment.