PushBullet API 身份验证? [英] PushBullet API Auth?

查看:73
本文介绍了PushBullet API 身份验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 PushBullet API,但我在验证 API 密钥时遇到了一些问题,主要是因为我不确定如何正确地向 API 发送 POST.

I am trying to use the PushBullet API but I am having some problems with it authenticating my API Key mainly because I am not sure how to properly make a POST to the API.

我尝试在线研究,但找不到 -u 的含义.这是否意味着它应该放在标题中或数据的一部分?

I tried researching online but I couldn't find what -u means. Does this mean it should go in the header or apart of the data?

curl https://api.pushbullet.com/api/pushes \
      -u API_KEY: \
      -d device_iden=u1qSJddxeKwOGuGW \
      -d type=note \
      -d title=Title \
      -d body=Body \
      -X POST

我试着像这样做一个邮递员(我屏蔽了钥匙和设备的去向):

I tried to do a Postman like so (I blocked out where the key and device go):

我做错了什么?

推荐答案

我发现我需要将 Authorization 添加到标题中.然后在标题中我使用密钥作为用户名.现在一切正常!

I figured it out I needed to add Authorization to the header. Then in the header I used the key as the username. All working now!

这篇关于PushBullet API 身份验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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