Skip to content

HTTPGet#

HttpGet #

HttpGet(
    *,
    path: TemplatedStringItem,
    slug: str,
    headers: dict[str, str] | None = None,
    as_dict: bool = False,
)

Spec for defining data from a http connector request.

Constructor for HttpGet class.

Parameters:

Name Type Description Default
path TemplatedStringItem

path to the data.

required
headers dict[str, str] | None

headers for the request.

None
slug str

slug of data connector.

required
as_dict bool

flag to return data as dictionary.

False

Dynamic Attribute Access#

The HttpGet class supports dynamic property access for building HTTP request paths. This includes both regular alphanumeric properties and numeric indices that require special underscore notation.

Example#

http_get = HttpGet(path="api/users", slug="my-connector")

# regular property access
http_get.products  
http_get.metadata

# numeric indices must be prefixed with an underscore
http_get._0 # represents index 0

# mixed usage
http_get._0.metadata # get metadata for the first element
http_get.products._2.metadata # get metadata for the third product

This design allows you to navigate complex nested data structures intuitively, whether you're accessing named properties or array indices.