如何从REST客户端推送通知测试目的 [英] How to push notification from rest client for testing purpose

查看:109
本文介绍了如何从REST客户端推送通知测试目的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我想从REST客户端推通知Android应用程序。我做像下面 -

Hi I am trying to push the notification from rest client to android app. I am doing like below -

URL - https://android.googleapis.com/gcm/send
Method - POST
Headers - Authorization: my_server_key

我总是得到这个消息

I always get this message

状态code:401未授权
  复用协议:443:QUIC,P = 0.002
  缓存控制:私人,最大年龄= 0

Status Code: 401 Unauthorized Alternate-Protocol: 443:quic,p=0.002 Cache-Control: private, max-age=0

我不知道我失踪&安培;最后我用正确的服务器API密钥。

I am not sure what I am missing & last I am using correct server api key.

请协助和放大器;先谢谢了。

Please assist & thanks in advance.

推荐答案

我在标题中设置这个值,那么它是为我工作的罚款。

I set this values in the header then it is working fine for me.

下面是标头键和放大器;值。

Below is the header key & value.

A)授权:放大器;它的价值关键喜欢API_KEY =

A) Authorization: & it value likes key=API_KEY

B)内容类型:应用程序/ JSON

B) Content-Type: application/json

这篇关于如何从REST客户端推送通知测试目的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆