else/Toolbox/head.py
Ethan Dalool b5a1649bc0 else
2017-11-03 12:50:16 -07:00

15 lines
300 B
Python

'''
Perform a HEAD request and print the results.
'''
import sys
import json
import requests
from voussoirkit import clipext
url = clipext.resolve(sys.argv[1])
page = requests.head(url)
headers = dict(page.headers)
headers = json.dumps(headers, indent=4, sort_keys=True)
print(page)
print(headers)