Skip to content

Instantly share code, notes, and snippets.

@rinormaloku

rinormaloku/App.js

Last active Jan 13, 2019
Embed
What would you like to do?
[Authenticating requests with Bearer Token] for the article series Intro to Istio https://rinormaloku.com/istio-an-introduction/
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
You can’t perform that action at this time.