We have made a simple application that supports CRUD operations on a student model(Get Student by ID, Delete Student by ID etc). Can someone help with how to make a simple restful api call to the endpoint(http://ip:port/allstudents) and render the obtained json format in React UI? My code is as follows:
import React, { Component } from 'react';
import './App.css';
class App extends Component {
Getfunction() {
<a href="http://www.stackoverflow.com/">
<button>b1</button>
</a>
}
render() {
return (
<div>
<button id='b1'
style={{fontSize: 20, color: 'green'}}
onClick={() => this.Getfunction()}>
Get!
</button>
);
}
}
export default App;
Where can I put my restful api call to query and how exactly?