-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added timeout, onUploadProgress and many more.
- Loading branch information
1 parent
efc4c07
commit 89f2f18
Showing
9 changed files
with
97 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# CAJAX (*ClassedAjax*) 3.0.2 | ||
# CAJAX (*ClassedAjax*) 3.0.3 | ||
CajaxJS is an lightweight JS Http client for everyone! | ||
|
||
#### NPM | ||
|
@@ -10,13 +10,13 @@ npm install cajaxjs | |
```html | ||
<script src="https://cdn.jsdelivr.net/npm/cajaxjs@x/dist/cajax.js"></script> | ||
<!-- OR --> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected].2/dist/cajax.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected].3/dist/cajax.js"></script> | ||
``` | ||
|
||
## CDN (module, works for Deno too) | ||
test.js | ||
```javascript | ||
import { Cajax } from 'https://cdn.jsdelivr.net/npm/[email protected].2/index.js' | ||
import { Cajax } from 'https://cdn.jsdelivr.net/npm/[email protected].3/index.js' | ||
|
||
new Cajax() | ||
.get("https://interaapps.de") | ||
|
@@ -28,7 +28,7 @@ new Cajax() | |
## Example Usage | ||
```js | ||
|
||
import { Cajax, CajaxRequest, CajaxResponse, FetchRequestProvider } from 'https://cdn.jsdelivr.net/npm/[email protected].2/index.js' | ||
import { Cajax, CajaxRequest, CajaxResponse, FetchRequestProvider } from 'https://cdn.jsdelivr.net/npm/[email protected].3/index.js' | ||
|
||
const client = new Cajax() | ||
|
||
|
@@ -62,6 +62,24 @@ client.get("https://interaapps.de", { | |
client.post("https://interaapps.de", { | ||
hello: "world" | ||
}) | ||
|
||
// File Upload | ||
const formData = new FormData() | ||
formData.append("file", document.getElementById("input").files[0]) | ||
client.post("/upload", formData) | ||
.then(res=>{ | ||
// ... | ||
}) | ||
|
||
|
||
// onProgress (Not supportet for FetchRequestProvider, use XHRHttpRequestProvider) | ||
client.get("https://interaapps.de", { | ||
hello: "world" | ||
}, { | ||
onProgress(event){ | ||
console.log(event.loaded+' of '+event.total) | ||
} | ||
}) | ||
``` | ||
|
||
## options | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "cajax", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "", | ||
"author": "", | ||
"keywords": [ | ||
|