|
1 | 1 | <p align="center"><img src="logo.png" alt="logo" width="300"></p>
|
2 | 2 |
|
3 |
| - |
4 | 3 | # JsonClient
|
5 | 4 |
|
6 | 5 | JsonClient is a JavaScript HTTP client specialized for JSON communications, based upon the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).
|
@@ -51,11 +50,11 @@ Therefore, this library enables you to ease your job at emitting POST requests.
|
51 | 50 | $json.post :: (
|
52 | 51 | url: string,
|
53 | 52 | data: any,
|
54 |
| - cache: $json.postOptionsEnums.Cache, |
55 |
| - credentials: $json.postOptionsEnums.Credentials, |
56 |
| - mode: $json.postOptionsEnums.Mode, |
57 |
| - redirect: $json.postOptionsEnums.Redirect, |
58 |
| - referrer: $json.postOptionsEnums.Referrer |
| 53 | + cache: $json.enums.Cache, |
| 54 | + credentials: $json.enums.Credentials, |
| 55 | + mode: $json.enums.Mode, |
| 56 | + redirect: $json.enums.Redirect, |
| 57 | + referrer: $json.enums.Referrer |
59 | 58 | ) -> Promise
|
60 | 59 | ```
|
61 | 60 |
|
@@ -106,6 +105,14 @@ There are only two dependencies :
|
106 | 105 |
|
107 | 106 | ## Changes
|
108 | 107 |
|
| 108 | +### v2.0.0 |
| 109 | + |
| 110 | +Renamed `$json.postOptionsEnums` to `$json.enums`. |
| 111 | + |
| 112 | +Added support for `PUT`, `DELETE` and `PATCH` methods (`$json.put`, `$json.delete` and `$json.patch` have the same signature as `$json.post`). |
| 113 | + |
| 114 | +Added support for method override via `$json.method`, it follows the same signature as `$json.post` but adds the first parameter `method` which designate the HTTP method to override. It exposes `X-HTTP-Method-Override`, `X-Method-Override` and `X-HTTP-Method` headers with the provided values. It also exposes default bound versions (`$json.method.put`, `$json.method.delete` and `$json.method.patch`) that have the same signature as `$json.post`. |
| 115 | + |
109 | 116 | ### v1.3.0
|
110 | 117 |
|
111 | 118 | Updated `fetchJSON` dependency to use its version `2.1.0` and provide defaults and customization to `$json.get`.
|
|
0 commit comments