"""Fetch content from a URL."""

import httpx


def run(url: str, *, timeout: float = 30.0) -> dict:
    """Fetch a URL and return its content.

    Args:
        url: The URL to fetch.
        timeout: Request timeout in seconds.

    Returns:
        dict with keys: status_code, content, headers, url
    """
    with httpx.Client(timeout=timeout, follow_redirects=True) as client:
        response = client.get(url)
        return {
            "status_code": response.status_code,
            "content": response.text,
            "headers": dict(response.headers),
            "url": str(response.url),
        }
