Below is my code to get response from webapi i am able to get results as count is showing right but it coming in [object object] format how to get proper json below is my line of code
const userList: ISuggestionItem[]=[];
this.props.context.aadHttpClientFactory
.getClient('xxxxxx-xxx-xxx-xxx-xxxx')
.then((client: AadHttpClient): void => {
client
.get('https://xxxxx.azurewebsites.net/api/xxxxxx?userEmail=xxxxx.onmicrosoft.com', AadHttpClient.configurations.v1)
.then((response:HttpClientResponse)=> {
console.log("First hit" + response)
response.json().then((responseJSON: any) => {
console.log("Second hit" + responseJSON.stringify)
responseJSON.map(function(item:any) {
console.log("third hit" + item.stringify)
userList.push({
"key" : item.Test1,
"displayValue" : item.Test2,
"searchValue": item.Test3
});
})
});
});
});