rust-fetch 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/package.json +2 -2
- package/rust_fetch_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ How to use the imported `WasmClient` to make HTTP requests from the browser or N
|
|
|
41
41
|
Here's how to make a simple GET request using `WasmClient`:
|
|
42
42
|
|
|
43
43
|
```javascript
|
|
44
|
-
import init, { WasmClient } from 'rust-fetch
|
|
44
|
+
import init, { WasmClient } from 'rust-fetch';
|
|
45
45
|
|
|
46
46
|
await init();
|
|
47
47
|
|
|
@@ -66,7 +66,7 @@ client.post_json('https://jsonplaceholder.typicode.com/posts', data)
|
|
|
66
66
|
### Using Fetch Functions
|
|
67
67
|
|
|
68
68
|
```javascript
|
|
69
|
-
import init, { fetch_json, fetch_text } from 'rust-fetch
|
|
69
|
+
import init, { fetch_json, fetch_text } from 'rust-fetch';
|
|
70
70
|
|
|
71
71
|
// Initialize WASM module
|
|
72
72
|
await init();
|
|
@@ -96,7 +96,7 @@ For more control and enhanced configurations, use the `fetch_with_options` to fi
|
|
|
96
96
|
You can specify HTTP method, headers, and body:
|
|
97
97
|
|
|
98
98
|
```javascript
|
|
99
|
-
import { fetch_with_options } from 'rust-fetch
|
|
99
|
+
import { fetch_with_options } from 'rust-fetch';
|
|
100
100
|
|
|
101
101
|
const url = 'https://jsonplaceholder.typicode.com/posts';
|
|
102
102
|
const method = 'POST';
|
|
@@ -139,7 +139,7 @@ try {
|
|
|
139
139
|
Fetches JSON data from the specified URL and returns it as a JavaScript object.
|
|
140
140
|
|
|
141
141
|
```javascript
|
|
142
|
-
import { fetch_json } from 'rust-fetch
|
|
142
|
+
import { fetch_json } from 'rust-fetch';
|
|
143
143
|
|
|
144
144
|
const data = await fetch_json('https://jsonplaceholder.typicode.com/todos/1');
|
|
145
145
|
```
|
|
@@ -148,7 +148,7 @@ const data = await fetch_json('https://jsonplaceholder.typicode.com/todos/1');
|
|
|
148
148
|
Fetches text/HTML content from the specified URL and returns it as a string.
|
|
149
149
|
|
|
150
150
|
```javascript
|
|
151
|
-
import { fetch_text } from 'rust-fetch
|
|
151
|
+
import { fetch_text } from 'rust-fetch';
|
|
152
152
|
|
|
153
153
|
const html = await fetch_text('https://example.com');
|
|
154
154
|
```
|
|
@@ -157,7 +157,7 @@ const html = await fetch_text('https://example.com');
|
|
|
157
157
|
Advanced fetch function with full control over the request.
|
|
158
158
|
|
|
159
159
|
```javascript
|
|
160
|
-
import { fetch_with_options } from 'rust-fetch
|
|
160
|
+
import { fetch_with_options } from 'rust-fetch';
|
|
161
161
|
|
|
162
162
|
const response = await fetch_with_options(
|
|
163
163
|
'https://api.example.com/users',
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"Asem Qaffaf <asem@qaffaf.com>"
|
|
6
6
|
],
|
|
7
7
|
"description": "A world-class WebAssembly HTTP client library with excellent error handling and clean API",
|
|
8
|
-
"version": "1.0.
|
|
8
|
+
"version": "1.0.3",
|
|
9
9
|
"license": "MIT OR Apache-2.0",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -28,4 +28,4 @@
|
|
|
28
28
|
"fetch",
|
|
29
29
|
"webassembly"
|
|
30
30
|
]
|
|
31
|
-
}
|
|
31
|
+
}
|
package/rust_fetch_bg.wasm
CHANGED
|
Binary file
|