You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/endpoints/entry.md
+58Lines changed: 58 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,3 +3,61 @@
3
3
Represent the top-level URI of an API. Used to address the various resources of the API.
4
4
5
5
The constructor of the entry endpoint requires you to specify the APIs root URL. It also provides optional parameters to override the default HTTP client, JSON serializer, [error handler](../error-handling/index.md) and [link handler](../link-handling/index.md).
6
+
7
+
## Usage
8
+
9
+
=== "C#"
10
+
11
+
```csharp
12
+
// Create an entry endpoint
13
+
var client = new EntryEndpoint(new Uri("http://example.com/api/"));
14
+
15
+
// With custom HTTP client
16
+
var httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(30) };
17
+
var client = new EntryEndpoint(httpClient);
18
+
19
+
// Access child endpoints
20
+
var contacts = new CollectionEndpoint<Contact>(client, "contacts");
21
+
```
22
+
23
+
=== "Java"
24
+
25
+
```java
26
+
// Create an entry endpoint
27
+
EntryEndpoint client = new EntryEndpoint(URI.create("http://example.com/api/"));
28
+
29
+
// With custom HTTP client
30
+
HttpClient httpClient = HttpClient.newBuilder()
31
+
.connectTimeout(Duration.ofSeconds(30))
32
+
.build();
33
+
EntryEndpoint client = new EntryEndpoint(httpClient);
34
+
35
+
// Access child endpoints
36
+
CollectionEndpoint<Contact> contacts = new CollectionEndpoint<>(client, "contacts", Contact.class);
37
+
```
38
+
39
+
=== "Kotlin"
40
+
41
+
```kotlin
42
+
// Create an entry endpoint
43
+
val client = EntryEndpoint(URI.create("http://example.com/api/"))
44
+
45
+
// With custom HTTP client
46
+
val httpClient = HttpClient.newBuilder()
47
+
.connectTimeout(Duration.ofSeconds(30))
48
+
.build()
49
+
val client = EntryEndpoint(httpClient)
50
+
51
+
// Access child endpoints
52
+
val contacts = CollectionEndpoint(client, "contacts", Contact::class.java)
53
+
```
54
+
55
+
=== "TypeScript"
56
+
57
+
```typescript
58
+
// Create an entry endpoint
59
+
const client = new EntryEndpoint(new URL("http://example.com/api/"));
60
+
61
+
// Access child endpoints
62
+
const contacts = new CollectionEndpoint<Contact>(client, "contacts");
0 commit comments