Last active
December 26, 2020 20:29
-
-
Save rinormaloku/928719c2e62b56e5a31a82cc1bf32cbb to your computer and use it in GitHub Desktop.
[Authenticating requests with Bearer Token] for the article series Intro to Istio https://rinormaloku.com/istio-an-introduction/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
analyzeSentence() { | |
fetch('/sentiment', { | |
method: 'POST', | |
headers: { | |
'Content-Type': 'application/json', | |
'Authorization': `Bearer ${auth.getAccessToken()}` // Access Token | |
}, | |
body: JSON.stringify({ sentence: this.textField.getValue() }) | |
}) | |
.then(response => response.json()) | |
.then(data => this.setState(data)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment