问题描述
我正在尝试通过Postman发送Gmail,但出现此错误:
这些是我配置的标题:
我已经配置了Google Cloud引擎所需的所有内容(Oauth权限,证书等),阅读了类似的文章,还尝试从gmail API游乐场进行测试,一切正常:
有什么问题的想法吗?
删除所有自定义标头,(按照以下步骤创建新请求)
步骤:
-
-
点击下载的文件为json,然后保存身份验证
-
打开邮递员,然后从授权标头中将授权设置为0auth2.0:
-
通过根据下载的json填充内容来生成新令牌(打开json并按照json中的说明填写邮递员)
将范围和状态设置为:
I'm trying to send a Gmail with Postman but got this error:
These are my configured headers:
I have configured everything needed on Google Cloud engine (Oauth permissions, certifications...etc), read similar posts, and also tried testing from gmail API playground and everything was ok:
Any idea of what could be wrong?
解决方案Remove all custome headers , (Create a new request by following below steps)
Steps:
https://console.developers.google.com/ Goto url and create an API. (by clicking credentials>create credentials)
https://console.developers.google.com/apis/api/gmail.googleapis.com/overview Goto url, click credentials> create new 0auth0.2 ( select applicaiton type as Web application)
While creating 0auth0.2 scroll down and set Authorized redirect URIs as https://localhost
CLick the download as json and then save the auth
Open postman and set authorization as 0auth2.0 from authorization header:
Generate new token by filling the content as per the downloaded json ( open the json and fill postman as in json)
set scope and state as : https://mail.google.com/ ( full access ) see scope at : https://developers.google.com/gmail/api/auth/scopes
In postman Set url as :https://gmail.googleapis.com/gmail/v1/users/praveendvd0pravu%40gmail.com/messages/send?key={YOURAPI_KEY_That_was_generated}
goto https://www.base64encode.org/ , and paste below content and click encode. Copy the output.
From: [email protected]: [email protected]: Hi
Hi this is
9): paste it as json body
{ "raw":"IEZyb206IHlvdXJlbWFpbEBnbWFpbC5jb20KIFRvOiB0b3NvbWVlbWFpbEBnbWFpbC5jb20KIFN1YmplY3Q6IEhpICAKICAgIApIaSB0aGlzIGlzIA==" }
- Send it :
这篇关于使用Postman发送Gmail时出现Application/Json错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
-