Skip to content

Instantly share code, notes, and snippets.



Last active Jan 13, 2019
What would you like to do?
[Authenticating requests with Bearer Token] for the article series Intro to Istio
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.