2.9.0
What's Changed
🏭 New feature(s)
- 🏭 Add BasicAuth addon by @BendingBender in #223
import BasicAuthAddon from "wretch/addons/basicAuth"
const user = "user"
const pass = "pass"
// Automatically sets the Authorization header to "Basic " + <base64 encoded credentials>
wretch("...").addon(BasicAuthAddon).basicAuth(user, pass).get()
// Allows using URLs with credentials in them
wretch(`https://${user}:${pass}@...`).addon(BasicAuthAddon).get()
- 🏭 Omit
null
andundefined
values from query string produced by QueryStringAddon by @dankochetov in #230
wretch('https://example.com')
.addon(QueryStringAddon)
// passing 'true' as the third argument will now ignore query parameters having undefined/null values
// the underlying url is now `https://example.com?bar=qwe` and foo is omitted
.query({ bar: 'qwe', foo: undefined }, false, true)
🐛 Bug fix(es)
const requestBody = new FormData()
requestBody.append("field1", "data 1");
requestBody.append("field2", "data 2");
// wretch will now check if the argument is an instance of `FormData` before trying to jsonify it
wretch().post(requestBody, "SERVER_URL")
⬆️ Version update(s)
- ⬆️ Bump follow-redirects from 1.15.4 to 1.15.6 by @dependabot in #224
New Contributors
- @BendingBender made their first contribution in #223
- @dankochetov made their first contribution in #230
- @am1rb made their first contribution in #232
Full Changelog: 2.8.1...2.9.0