Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #52: document :throw option #53

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Options used to create the (implicit) default client.
```

Convenience wrapper for [`request`](#babashka.http-client/request) with method `:delete`
<p><sub><a href="https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L132-L137">Source</a></sub></p>
<p><sub><a href="https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L133-L138">Source</a></sub></p>

## <a name="babashka.http-client/get">`get`</a><a name="babashka.http-client/get"></a>
``` clojure
Expand All @@ -190,7 +190,7 @@ Convenience wrapper for [`request`](#babashka.http-client/request) with method `
```

Convenience wrapper for [`request`](#babashka.http-client/request) with method `:get`
<p><sub><a href="https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L125-L130">Source</a></sub></p>
<p><sub><a href="https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L126-L131">Source</a></sub></p>

## <a name="babashka.http-client/head">`head`</a><a name="babashka.http-client/head"></a>
``` clojure
Expand All @@ -200,7 +200,7 @@ Convenience wrapper for [`request`](#babashka.http-client/request) with method `
```

Convenience wrapper for [`request`](#babashka.http-client/request) with method `:head`
<p><sub><a href="https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L139-L144">Source</a></sub></p>
<p><sub><a href="https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L140-L145">Source</a></sub></p>

## <a name="babashka.http-client/patch">`patch`</a><a name="babashka.http-client/patch"></a>
``` clojure
Expand All @@ -210,7 +210,7 @@ Convenience wrapper for [`request`](#babashka.http-client/request) with method `
```

Convenience wrapper for [`request`](#babashka.http-client/request) with method `:patch`
<p><sub><a href="https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L153-L160">Source</a></sub></p>
<p><sub><a href="https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L154-L161">Source</a></sub></p>

## <a name="babashka.http-client/post">`post`</a><a name="babashka.http-client/post"></a>
``` clojure
Expand All @@ -220,7 +220,7 @@ Convenience wrapper for [`request`](#babashka.http-client/request) with method `
```

Convenience wrapper for [`request`](#babashka.http-client/request) with method `:post`
<p><sub><a href="https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L146-L151">Source</a></sub></p>
<p><sub><a href="https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L147-L152">Source</a></sub></p>

## <a name="babashka.http-client/put">`put`</a><a name="babashka.http-client/put"></a>
``` clojure
Expand All @@ -230,7 +230,7 @@ Convenience wrapper for [`request`](#babashka.http-client/request) with method `
```

Convenience wrapper for [`request`](#babashka.http-client/request) with method `:put`
<p><sub><a href="https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L162-L169">Source</a></sub></p>
<p><sub><a href="https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L163-L170">Source</a></sub></p>

## <a name="babashka.http-client/request">`request`</a><a name="babashka.http-client/request"></a>
``` clojure
Expand All @@ -256,10 +256,11 @@ Perform request. Returns map with at least `:body`, `:status`
* `:async` - perform request asynchronously. The response will be a `CompletableFuture` of the response map.
* `:async-then` - a function that is called on the async result if successful
* `:async-catch` - a function that is called on the async result if exceptional
* `:timeout` - request timeout in milliseconds.
* `:timeout` - request timeout in milliseconds
* `:throw` - throw on exceptional status codes, all other than `#{200 201 202 203 204 205 206 207 300 301 302 303 304 307}`
* `:version` - the HTTP version: `:http1.1` or `:http2`.

<p><sub><a href="https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L100-L123">Source</a></sub></p>
<p><sub><a href="https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L100-L124">Source</a></sub></p>

-----
# <a name="babashka.http-client.interceptors">babashka.http-client.interceptors</a>
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Babashka [http-client](https://github.com/babashka/http-client): HTTP client for
## Unreleased

- [#49](https://github.com/babashka/http-client/issues/49): add `::oauth-token` interceptor
- [#52](https://github.com/babashka/http-client/issues/52): document `:throw` option

## 0.4.16 (2024-02-10)

Expand Down
3 changes: 2 additions & 1 deletion src/babashka/http_client.clj
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@
* `:async` - perform request asynchronously. The response will be a `CompletableFuture` of the response map.
* `:async-then` - a function that is called on the async result if successful
* `:async-catch` - a function that is called on the async result if exceptional
* `:timeout` - request timeout in milliseconds.
* `:timeout` - request timeout in milliseconds
* `:throw` - throw on exceptional status codes, all other than `#{200 201 202 203 204 205 206 207 300 301 302 303 304 307}`
* `:version` - the HTTP version: `:http1.1` or `:http2`.
"
[opts]
Expand Down
Loading