Skip to content

Commit

Permalink
📝 Fix readme bad chars.
Browse files Browse the repository at this point in the history
  • Loading branch information
elbywan committed Oct 12, 2020
1 parent 0bb3235 commit 12b7231
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ wretch("anything")
.get()
.notFound(error => { /* ... */ })
.unauthorized(error => { /* ... */ })
.error(418, error => { /* ... */ })
.error(418, error => { /* ... */ })
.res(response => /* ... */)
.catch(error => { /* uncaught errors */ })
```
Expand Down Expand Up @@ -349,7 +349,7 @@ const qsWretch = wretch().defer((w, url, { qsQuery, qsOptions }) => (

qsWretch
.url("https://example.com/")
.options({ qs: { query: queryObject }})
.options({ qs: { query: queryObject }})
/* ... */
```

Expand Down Expand Up @@ -466,7 +466,7 @@ const reAuthOn401 = wretch()
const token = await wretch("/renewtoken").get().text()
storeToken(token)
// Replay the original request with new credentials
return request.auth(token).replay().unauthorized(err => { throw err }).json()
return request.auth(token).replay().unauthorized(err => { throw err }).json()
})

reAuthOn401.url("/resource")
Expand Down Expand Up @@ -536,7 +536,7 @@ Sets default fetch options which will be used for every subsequent requests.
wretch().defaults({ headers: { "Accept": "application/json" }})

// The fetch request is sent with both headers.
wretch("...", { headers: { "X-Custom": "Header" }}).get()
wretch("...", { headers: { "X-Custom": "Header" }}).get()
```

```js
Expand Down Expand Up @@ -605,7 +605,7 @@ wretch("...").put("hello")
#### json(jsObject: Object)
Sets the content type header, stringifies an object and sets the request body.
Sets the "Content-Type" header, stringifies an object and sets the request body.
```js
const jsonObject = { a: 1, b: 2, c: 3 }
Expand Down Expand Up @@ -674,7 +674,7 @@ wretch("...").formUrl(alreadyEncodedForm).post()
// This shorthand:
wretch().post({ json: 'body' }, { credentials: "same-origin" })
// Is equivalent to:
wretch().json({ json: 'body'}).options({ credentials: "same-origin" }).post()
wretch().json({ json: 'body'}).options({ credentials: "same-origin" }).post()
```
**NOTE:** For methods having a body argument if the value is an `Object` it is assumed that it is a JSON payload and apply the same behaviour
Expand Down Expand Up @@ -809,7 +809,7 @@ wretch("/resource")
const token = await wretch("/renewtoken").get().text()
storeToken(token)
// Replay the original request with new credentials
return req.auth(token).get().unauthorized(err => { throw err }).json()
return req.auth(token).get().unauthorized(err => { throw err }).json()
})
.json()
// The promise chain is preserved as expected
Expand Down Expand Up @@ -870,15 +870,15 @@ FormData handler.
wretch("...").get().formData(formData => /* ... */)
```
#### arrayBuffer(cb: (ab : ArrayBuffer) => T) : Promise<ArrayBuffer | T>
#### arrayBuffer(cb: (ab : ArrayBuffer) => T) : Promise<ArrayBuffer | T>
ArrayBuffer handler.
```js
wretch("...").get().arrayBuffer(arrayBuffer => /* ... */)
```
#### text(cb: (text : string) => T) : Promise<string | T>
#### text(cb: (text : string) => T) : Promise<string | T>
Text handler.
Expand Down

0 comments on commit 12b7231

Please sign in to comment.