I'm not able to read the Response
in the ReactJS code, but the API Call is returning the proper JSON data with Response Code: 200
My ReactJS code is
fetch('http://localhost:8090/api/Contact/GetContactType', {mode: 'no-cors'})
.then(response=> {
console.log(response.data);
console.log(response);
});
The Web API is returning the following JSON to the browser
[
{
"ContactTypeId":1,
"ContactType":"Seller"
},
{
"ContactTypeId":2,
"ContactType":"Re-Seller"
}
]
Kindly help me to read the following JSON using ReactJS
Response of Answer : @OB3:
I tried the same, but I'm getting the Exception. Kindly refer the Screenshot and help me.
You would have to parse the response body first.