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
+93Lines changed: 93 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,6 +120,99 @@ return value of `Next` is `None`, then there are no more pages to be fetched.
120
120
Here's an example of one such pagination call:
121
121
<!-- End Pagination -->
122
122
123
+
124
+
125
+
<!-- Start Error Handling -->
126
+
# Error Handling
127
+
128
+
Handling errors in your SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type.
129
+
130
+
131
+
<!-- End Error Handling -->
132
+
133
+
134
+
135
+
<!-- Start Server Selection -->
136
+
# Server Selection
137
+
138
+
## Select Server by Name
139
+
140
+
You can override the default server globally by passing a server name to the `server: str` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers:
The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
172
+
173
+
174
+
```python
175
+
import speakeasy
176
+
from speakeasy.models import shared
177
+
178
+
s = speakeasy.Speakeasy(
179
+
security=shared.Security(
180
+
api_key="",
181
+
),
182
+
server_url="https://api.prod.speakeasyapi.dev"
183
+
)
184
+
185
+
186
+
res = s.speakeasy.validate_api_key()
187
+
188
+
if res.status_code ==200:
189
+
# handle response
190
+
pass
191
+
```
192
+
<!-- End Server Selection -->
193
+
194
+
195
+
196
+
<!-- Start Custom HTTP Client -->
197
+
# Custom HTTP Client
198
+
199
+
The Python SDK makes API calls using the (requests)[https://pypi.org/project/requests/] HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `requests.Session` object.
200
+
201
+
202
+
For example, you could specify a header for every request that your sdk makes as follows:
0 commit comments