def get_drawing_feed_old_api(self, auth, file_id): url = settings.MAIN_SERVER_URI + '/main/drawingfeed/v1/file/' + str( file_id) ticket = ClientUtils.get_ticket_value_from_authorization_header(auth) headers = {} headers.__setitem__('ticket', ticket) headers.__setitem__('isMobile', True) headers.__setitem__('x-ads-device-type', settings.DEVICE_TYPE_HEADER) try: return requests.get(url=url, headers=headers) except Exception as e: print('DrawingFeedClient.get_drawing_feed_old_api: file id: ' + str(file_id) + '. Exception msg: ' + str(e.message) + '. Exception args: ' + str(e.args) + '\n') return None
def new_post_old_api(self, auth, file_id, post_body): url = settings.MAIN_SERVER_URI + '/main/drawingfeed/v1/file/' + str( file_id) ticket = ClientUtils.get_ticket_value_from_authorization_header(auth) headers = {} headers.__setitem__('Content-type', 'application/json') headers.__setitem__('ticket', ticket) headers.__setitem__('isMobile', True) headers.__setitem__('x-ads-device-type', settings.DEVICE_TYPE_HEADER) body = {} body.__setitem__('body', post_body) try: return requests.post(url=url, headers=headers, data=json.dumps(body)) except Exception as e: print('DrawingFeedClient.new_post_old_api: file_id: ' + str(file_id) + '. body: ' + str(body) + '. Exception msg: ' + str(e.message) + '. Exception args: ' + str(e.args) + '\n') return None