Skip to content

Commit bc515a6

Browse files
docs: Added headers in Code Guide
1 parent cb9d1de commit bc515a6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,13 @@ from api_to_dataframe import ClientBuilder, RetryStrategies
5353

5454
# Create a client for the API without retry strategy and default timeout (5 seconds)
5555
client = ClientBuilder(endpoint="https://api.example.com")
56-
# or with LinearStrategy (In development, actually don't nothing)
57-
client = ClientBuilder(endpoint="https://api.example.com", retry_strategy=RetryStrategies.LinearStrategy)
58-
# if you can define timeout, use: (default is 5 seconds)
59-
client = ClientBuilder(endpoint="https://api.example.com", retry_strategy=RetryStrategies.LinearStrategy, timeout=10)
56+
# if you can define timeout, use: (default is 5 seconds), with LinearStrategy (In development, actually don't nothing) and set headers:
57+
headers = {
58+
"application_name": "api_to_dataframe"
59+
}
60+
client = ClientBuilder(endpoint="https://api.example.com", retry_strategy=RetryStrategies.LinearStrategy, timeout=10, headers=headers)
61+
62+
### timeout, retry_strategy and headers are opcionals parameters
6063

6164
# Get data from the API
6265
data = client.get_api_data()

0 commit comments

Comments
 (0)