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, timeout=None)¶
基类:
object
Connect operation with the server, request.
- property 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.
- 参数:
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.
- 返回:
Response data.
- 返回类型:
dict or List
- 抛出:
RayVisionAPIError -- The request failed, It returns the error ID, the error message, and the request address.