# Collection of code snippets by Arne Vajhøj 
# (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import requests

url = 'http://localhost/test.txt'

response = requests.head(url)

if response.status_code == 200:
    print("URL:", response.url)
    print("Content Type:", response.headers['Content-Type'])
    print("Content Length:", response.headers['Content-Length'])
    print("Last Modified:", response.headers['Last-Modified'])
else:
    print("Failed to retrieve metadata. Status code:", response.status_code) 
