exponent_server_sdk.PushServerError:请求失败

时间:2018-09-23 19:57:08

标签: python django-rest-framework

我正在将exponent_server_sdk用于Python(Django Rest),并且不断收到此错误:

exponent_server_sdk.PushServerError: Request failed

我的代码如下:

@api_view(["POST"])
@permission_classes((AllowAny, ))
def send_push_message(request):
    token =  request.data['token']  
    title =  request.data['title']
    message = request.data['message'] 
    extra = request.data['extra'] 
    try:
        response = PushClient().publish(
            PushMessage(to=token, title=title, body=message, data=extra))
    except PushServerError as exc:
        rollbar.report_exc_info(
            extra_data={'token': token, 'title': title, 'message': message,'extra': extra, 'errors': exc.errors, 'response_data': exc.response_data,})

0 个答案:

没有答案