Connect¶
Request, request header and request result processing.
- class rayvision_api.connect.Connect(access_id, access_key, protocol, domain, platform, headers=None)¶
基类:
object
Connect operation with the server, request.
- static assemble_api_url(domain, operators, protocol='https')¶
Assemble the requests api url.
- property headers¶
Get request headers dic.
- post(api_url, data=None)¶
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.
- 参数:
- 返回:
Response data.
- 返回类型:
dict or List
- 抛出:
RayVisionAPIError -- The request failed, It returns the error ID, the error message, and the request address.