Connect¶
Request, request header and request result processing.
-
class
rayvision_api.connect.
Connect
(access_id, access_key, protocol, domain, platform, headers=None, session=None, logger=None)¶ Bases:
object
Connect operation with the server, request.
-
headers
¶ Get request headers dic.
-
post
(api_url, data=None, validator=True)¶ Send an post request and return data object if no error occurred.
Request processing through the decorator, if the request fails more than five times, then the exception is ran out.
Parameters: - api_url (rayvision_api.api.url.URL or str) –
The URL address of the corresponding action network Request.
- e.g.:
- /api/render/common/queryPlatforms /api/render/user/queryUserProfile /api/render/user/queryUserSetting
- data (dict, optional) – Request data.
- validator (bool, optional) – Validator the data.
Returns: Response data.
Return type: dict or List
Raises: RayVisionAPIError
– The request failed, It returns the error ID, the error message, and the request address.- api_url (rayvision_api.api.url.URL or str) –
-