Ich versuche, die Taxee.io API mit dem Request Npm-Modul zuzugreifen. Die Dokumentation ist etwas dürftig und der Unterschied zwischen den Mashape-Informationen und den Informationen der Website ist verwirrend.Verwendung von Taxee.io API
Die docs haben ein Beispiel für eine hier Anfrage.
curl 'https://taxee.io/api/v2/calculate/2017' -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJBUElfS0VZX01BTkFHRVIiLCJodHRwOi8vdGF4ZWUuaW8vdXNlcl9pZCI6IjU4NDQ4MTA4Mzg2NjhhMTU4ZDU0ZmIzNSIsImh0dHA6Ly90YXhlZS5pby9zY29wZXMiOlsiYXBpIl0sImlhdCI6MTQ5OTA1MzU0NX0.pOwC5JEC7trLaaZVgHHGu_rvN0-EGa3RMm8BgJ-M9gk' -H 'Content-Type: application/x-www-form-urlencoded' --data 'state=NC&filing_status=married&pay_periods=26&pay_rate=116500&exemptions=2'
Ich möchte jedoch die Anfrage npm Modul verwenden und bin kämpfen, um die Lücke in der zu überbrücken, wie es in meiner ausdrücklichen App funktioniert.
const request = require('request');
request.post('https://taxee.io/api/v2/calculate/2017', {
'auth': {
'Bearer': 'mykey'
}
});
Dies ist, was ich bisher habe. Jede Hilfe wird geschätzt.
Die Antwort, die ich ist wieder kein Auth Mechanismus – Aaron