Skip to main content

Module client

Module client 

Source
Expand description

The authorized HTTP client: token handling, the 401 retry and the mapping of error replies.

The methods in this file are generic (BcsHttpClient::get, BcsHttpClient::post and so on). The endpoint-specific methods (get_order_book, create_order, …) are in super::endpoints.

Structs§

BcsHttpClient
The authorized HTTP client of the BCS Trade API.

Constants§

AUTH_TOKEN_PATH
Path of the token endpoint on the REST host (POST, form-encoded).
HTTP_BASE_URL
Production base URL of the REST API. BcsConfig::new and BcsConfig::from_env use it.
REQUEST_TIMEOUT
A request timeout of 30 seconds.
WS_BASE_URL
Production base URL of the WebSocket API. BcsConfig::new and BcsConfig::from_env use it.