actions.py 文件源码

python
阅读 37 收藏 0 点赞 0 评论 0

项目:pyucwa 作者: tonybaloney 项目源码 文件源码
def oauth_post_request(uri, oauth_token, origin, msg):
    uid = uuid.uuid1()
    headers = {
        'Authorization': 'Bearer %s' % oauth_token,
        'Origin': origin,
        'Client-Request-Id': 'WebSDK/%s' % uid,
        'Accept': 'application/json',
        'Content-Type': 'application/json',
        'X-MS-Correlation-Id': uid,
        'X-Ms-Namespace': 'internal',
        'X-Ms-SDK-Instance': USER_AGENT,
        'Referer': origin + '/'
    }
    response = requests.post(uri, data=json.dumps(msg), headers=headers, verify=False)
    response.raise_for_status()
    if response.text != '':
        return response.json()
    else:
        return {}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号