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
{{ message }}
This repository was archived by the owner on Oct 1, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: docs/v3/docs/api.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,24 @@
1
1
---
2
2
title: API
3
3
---
4
-
5
4
## Introduction
6
-
5
+
::: warning Sorry!
6
+
This page is not up to standards, improvements need to be made inline with the rest of the documentation.
7
+
:::
7
8
# API
8
9
9
10
This is Pulse's integrated fetch API. It's a wrapper around Fetch, which is native to the browser environment.
10
-
11
+
```ts
12
+
const MyAPI =App.API()
13
+
```
11
14
## Setup
12
-
13
-
To create an api instance, you must pass a config object. This will define several things such as the options, baseurl, path, timeout and some functions to run before and after each http request.
14
-
15
+
The API class accepts a config object.
15
16
```ts
16
17
const MyAPI =App.API({
17
18
options: {
18
19
headers: {
19
20
'content-type': 'application/json, text/plain'// this is not necessary
This function allows you to override the API config and request options. It returns a modified instance of the original API with the options in the config parameter overriding the original config options.
79
79
@@ -85,7 +85,7 @@ This function allows you to override the API config and request options. It retu
85
85
86
86
-[response (Response)](#response)
87
87
88
-
## `API.get()`
88
+
#`.get()`
89
89
90
90
Send a HTTP get request to a url
91
91
@@ -98,7 +98,7 @@ Send a HTTP get request to a url
98
98
99
99
-[response (Response)](#response)
100
100
101
-
## `API.post()`
101
+
#`.post()`
102
102
103
103
Send a HTTP post request to a URL
104
104
@@ -112,7 +112,7 @@ Send a HTTP post request to a URL
112
112
113
113
-[response (Response)](#response)
114
114
115
-
## `API.put()`
115
+
#`.put()`
116
116
117
117
Send a HTTP put request to a URL
118
118
@@ -126,7 +126,7 @@ Send a HTTP put request to a URL
126
126
127
127
-[response (Response)](#response)
128
128
129
-
## `API.patch()`
129
+
#`.patch()`
130
130
131
131
Send a HTTP patch request to a URL
132
132
@@ -140,7 +140,7 @@ Send a HTTP patch request to a URL
0 commit comments