You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-18Lines changed: 19 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,16 +4,16 @@
4
4
-[Quick Start](#quick-start)
5
5
-[Installation](#installation)
6
6
-[Structure and Functionality](#structure-and-functionality)
7
-
-[`HttpClient`](#httpclient)
7
+
-[HttpClient](#httpclient)
8
8
-[Initialization](#initialization)
9
-
-[Default arguments](#default-arguments)
10
-
-[Basic authentication](#basic-authentication)
11
-
-[Simple POST request](#simple-post-request)
12
-
-[Working with URL paths](#working-with-url-paths)
13
-
-[Raw request Example](#raw-request-example)
14
-
-[Building HTTP client based on HTTPClient Example](#building-http-client-based-on-httpclient-example)
15
-
-[Async Usage](#async-usage)
16
-
-[Building HTTP client based on AsyncHttpClient Example](#building-http-client-based-on-asynchttpclient-example)
9
+
-[Default Arguments](#default-arguments)
10
+
-[Basic Authentication](#basic-authentication)
11
+
-[Simple POST Request](#simple-post-request)
12
+
-[Working with URL Paths](#working-with-url-paths)
13
+
-[Raw Request Example](#raw-request-example)
14
+
-[Example Client Based on HTTPClient](#example-client-based-on-httpclient)
15
+
-[AsyncHttpClient](#asynchttpclient)
16
+
-[Example Client Based on AsyncHttpClient](#example-client-based-on-asynchttpclient)
17
17
18
18
# Python HTTP Client
19
19
@@ -49,7 +49,7 @@ pip install keboola.http-client
49
49
The package contains a single core module:
50
50
-`keboola.http_client` - Contains the `HttpClient` class for easy manipulation with APIs and external services
51
51
52
-
### `HttpClient`
52
+
### HttpClient
53
53
54
54
The core class that serves as a tool to communicate with external services. The class is a wrapper around the `requests` library with implemented retry mechanism, and automatic error handling in case of HTTP error returned.
For `HttpClient`, it is possible to define default arguments, which will be sent with every request. It's possible to define `default_http_header`, `auth_header` and `default_params` - a default header, a default authentication header and default parameters, respectively.
82
82
@@ -96,7 +96,7 @@ cl = HttpClient(
96
96
)
97
97
```
98
98
99
-
#### Basic authentication
99
+
#### Basic Authentication
100
100
101
101
By specifying the `auth` argument, the `HttpClient` will utilize the basic authentication.
Each of the methods takes an optional positional argument `endpoint_path`. If specified, the value of the `endpoint_path` will be appended to the URL specified in the `base_url` parameter, when initializing the class. When appending the `endpoint_path`, the [`urllib.parse.urljoin()`](https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urljoin) function is used.
0 commit comments