当尝试使用来自 Google Playground 的 FireBase 通知 API 时,“invalid_argument”会返回一个错误的请求 (400) 响应。
有没有人已经面临这个问题?
POST /v1/projects/project-XXXXX/messages:send HTTP/1.1
Host: fcm.googleapis.com
Content-length: 172
Content-type: application/json
Authorization: Bearer ya29.GlsmBVbYFheJHcCs7EWdiOeBmMblU-9lgeTy4x_L3W2saI21mUV87UilRMtWQyRwHdQRrxTKEm0rdrwymqyWHpMxXBZZPKeOAX4n2o9GQzZp-wmyVEksoXXrAPOO
{
"message":{
"token":"bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1",
"notification":{
"title":"My Title",
"body":"This is the body!"
}
}
}
HTTP/1.1 400 Bad Request
Content-length: 127
X-xss-protection: 1; mode=block
X-content-type-options: nosniff
Transfer-encoding: chunked
Vary: Origin, X-Origin, Referer
Server: ESF
-content-encoding: gzip
Cache-control: private
Date: Mon, 18 Dec 2017 15:41:16 GMT
X-frame-options: SAMEORIGIN
Alt-svc: hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=":443"; ma=2592000; v="41,39,38,37,35"
Content-type: application/json; charset=UTF-8
{
"error": {
"status": "INVALID_ARGUMENT",
"message": "Request contains an invalid argument.",
"code": 400
}
}