Skip to content

How to auth requests #7

@byroncoetsee

Description

@byroncoetsee

Hi

How do I authorise requests?

All my requests keep getting redirected to port 2000 (essentially unauthenticated).
I've read I can use session cookies or proxy cookies but those expire quite quickly, and then require manual copy pasta again. This makes it a pretty inefficient.

I've also tried basic auth in the network request - no luck.

For what its worth, here is my current Python code:

        url = f"{API_BASE_URL}/address/{address}?limit=100&sort=desc"
        try:
            response = requests.get(url, auth=HTTPBasicAuth(API_USERNAME, API_PASSWORD))
            response.raise_for_status()
            data = response.json()
            return cls.from_json(data)
        except requests.RequestException as e:
            print(f"Error fetching address {address}: {e}")
            return None
        except ValueError as e:
            print(f"Error parsing JSON for address {address}: {e}")
            return None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions