v0.2.0
- Major functionality update: beyond `getJson()` and `postForJson()`,
m3api-rest now supports the following:
- request methods:
- GET
- POST
- PUT
- DELETE
- PATCH
- request body content types:
- `application/json`
- `application/x-www-form-urlencoded`
- `multipart/form-data`
- response body content types:
- `application/json`
- `text/plain`
- `text/html`
Yielding the following full list of request functions:
- `getJson()`
- `getText()`
- `getHtml()`
- `postForJson()`
- `postForText()`
- `postForHtml()`
- `putForJson()`
- `putForText()`
- `putForHtml()`
- `deleteForJson()`
- `deleteForText()`
- `deleteForHtml()`
- `patchForJson()`
- `patchForText()`
- `patchForHtml()`
- BREAKING CHANGE: `getJson()` and `postForJson()` can now return
`String` instances in addition to objects and arrays, if the server
returns JSON-encoded strings. (This is unlikely for MediaWiki core’s
REST API endpoints, but common in the Wikibase REST API.)
- BREAKING CHANGE: The `body` property of the `RestApiServerError`,
`RestApiClientError` and `UnexpectedResponseStatus` classes is now
documented with the type `*` (“any”) rather than `string|Object`. The
previous type was incorrect – if the server response is JSON,
m3api-rest just decodes it for the error without checking if it’s an
object or not. (You almost certainly don’t need to care about this
change, but it’s technically breaking.)