Reactjs – Creating a post request using axios in react to send data to a Spring Boot endpoint
import {useState} from 'react'; import axios from "axios"; export default function CreateiPhone(){ const [iphone, setiPhone] = useState({ id: "", name: "", model: "", configuration: "", imgUrl: "", }); const handleChange = (e) => { const value = e.target.value; setiPhone({...iphone, [e.target.name]:…