Namespace TypedRest.Endpoints
Endpoints represent URIs that provides methods for operating on specific resources.
Rather than assembling URIs and requests by hand, you compose endpoints into a tree that mirrors the API: an EntryEndpoint at the base URI exposes child endpoints as properties, and those may expose children of their own. See Endpoint types for the available types and what each child inherits from its referrer.
class MyClient(Uri uri) : EntryEndpoint(uri)
{
public CollectionEndpoint<Contact> Contacts => new(this, relativeUri: "./contacts");
}
Endpoints are cheap value-like objects, not connections. Creating one performs no I/O; only calling one of its methods sends a request. That is why they are usually exposed as get-only properties returning a new instance each time.
Write your own endpoint types by deriving from EndpointBase, which handles URI resolution, serialization, error handling and link extraction for you.
Namespaces
- TypedRest.Endpoints.Generic
Generic endpoints allow you to model collections and elements.
- TypedRest.Endpoints.Raw
Raw endpoints allow you to transmit binary data rather than serialized objects.
- TypedRest.Endpoints.Reactive
Reactive endpoints allow you to receive data as push streams rather than explicitly pulling.
- TypedRest.Endpoints.Rpc
RPC endpoints allow you to interact with non-RESTful resources that act like callable functions.
Classes
- EndpointBase
Base class for building endpoints, i.e. remote HTTP resources.
- EntryEndpoint
Represent the top-level URI of an API. Derive from this class and add your own set of child-IEndpoints as properties.
Interfaces
- ICachingEndpoint
Endpoint that caches the last response.
- IEndpoint
Endpoint, i.e. a remote HTTP resource.