I'm trying to send a state created in the front react js part to the backend spring boot part and read my state in JSON mode, I used Axios but I get this error:
Request failed with status code 400
my frontend code :
onSubmit(e){
e.preventDefault();
const FilterRegion={
//region
eu:this.state.eu,
americas:this.state.americas,
aae:this.state.aae,
ger:this.state.ger,
eu2:this.state.eu2,
latam : this.state.latam,
empty:this.state.empty,
allregion:this.state.allregion,
}
console.log(FilterRegion)
axios.get("http://localhost:8080/MenuFiltre/filtreregioncloser",FilterRegion)
}
Controller in back end :
@Controller
@RequestMapping("/MenuFiltre")
@RestController
@CrossOrigin()
public class MenuFiltre {
@GetMapping("/filtreregioncloser")
public Iterable<Closerfprfx>gettab1(@RequestBody String jsonStr)
{
JSONObject jObject = new JSONObject(jsonStr);
System.out.println(jsonStr);
return null;
}
}