I am trying below code but always get undefined in console for console.log(responseJSON.Title);
this.props.context.spHttpClient.get(`https://someazuresite.azurewebsites.net/api`,
SPHttpClient.configurations.v1)
.then((response: SPHttpClientResponse) => {
return response.json().then((responseJSON: any) => {
console.log(responseJSON.Title);
});
});
[]
responseJSON
? Is it an object or array?["Saab", "Volvo", "BMW"];
and array of objects is like:[{Title:"Title 1",id:"1"}, {Title:"Title 2",id:"2"}]
. Can you add screenshot of response to your original question?