Interface IEndpoint
Endpoint, i.e. a remote HTTP resource.
Namespace: TypedRest.Endpoints
Assembly: TypedRest.dll
Syntax
public interface IEndpoint
Properties
ErrorHandler
Handles errors in responses.
Declaration
IErrorHandler ErrorHandler { get; }
Property Value
Type | Description |
---|---|
IErrorHandler |
HttpClient
The HTTP client used to communicate with the remote resource.
Declaration
HttpClient HttpClient { get; }
Property Value
Type | Description |
---|---|
HttpClient |
LinkExtractor
Extracts links from responses.
Declaration
ILinkExtractor LinkExtractor { get; }
Property Value
Type | Description |
---|---|
ILinkExtractor |
Serializer
Controls the serialization of entities sent to and received from the server.
Declaration
MediaTypeFormatter Serializer { get; }
Property Value
Type | Description |
---|---|
System.Net.Http.Formatting.MediaTypeFormatter |
Uri
The HTTP URI of the remote resource.
Declaration
Uri Uri { get; }
Property Value
Type | Description |
---|---|
Uri |
Methods
GetLinks(String)
Resolves all links with a specific relation type. Uses cached data from last response.
Declaration
IReadOnlyList<(Uri, string)> GetLinks(string rel)
Parameters
Type | Name | Description |
---|---|---|
String | rel | The relation type of the links to look for. |
Returns
Type | Description |
---|---|
IReadOnlyList<(, )<Uri, String>> |
Link(String)
Resolves a single link with a specific relation type. Uses cached data from last response if possible. Tries lazy lookup with HTTP HEAD on cache miss.
Declaration
Uri Link(string rel)
Parameters
Type | Name | Description |
---|---|---|
String | rel | The relation type of the link to look for. |
Returns
Type | Description |
---|---|
Uri |
Exceptions
Type | Condition |
---|---|
KeyNotFoundException | No link with the specified |
LinkTemplate(String, IDictionary<String, Object>)
Resolves a link template with a specific relation type. Uses cached data from last response if possible. Tries lazy lookup with HTTP HEAD on cache miss.
Declaration
Uri LinkTemplate(string rel, IDictionary<string, object> variables)
Parameters
Type | Name | Description |
---|---|---|
String | rel | The relation type of the link template to look for. |
IDictionary<String, Object> | variables | Variables for resolving the template. |
Returns
Type | Description |
---|---|
Uri | The href of the link resolved relative to this endpoint's URI. |
Exceptions
Type | Condition |
---|---|
KeyNotFoundException | No link template with the specified |
LinkTemplate(String, Object)
Resolves a link template with a specific relation type.
Declaration
Uri LinkTemplate(string rel, object variables)
Parameters
Type | Name | Description |
---|---|---|
String | rel | The relation type of the link template to look for. |
Object | variables | An object used to provide properties for resolving the template. |
Returns
Type | Description |
---|---|
Uri | The href of the link resolved relative to this endpoint's URI. |
Remarks
Uses cached data from last response if possible. Tries lazy lookup with HTTP HEAD on cache miss.
Exceptions
Type | Condition |
---|---|
KeyNotFoundException | No link template with the specified |