title: How to use spring boot java to properly use axios.post from React
body: <p>So I am using axios.post on React
  here is my code</p>
  
  <p>React GenService.jsx</p>
  
  <pre><code>import axios from "axios";
  import { Route, withRouter } from "react-router-dom";
  
  
  const COURSE_API_URL = "http://localhost:8080";
  
  
  class GenService {
    retrieveAll() {
      return axios.get(`${COURSE_API_URL}`);
    }
    pAll() {
      return axios.post(`${COURSE_API_URL}` + "/user", {
        firstName: "Fred",
        lastName: "Flintstone"
      });
    }
  }
  
  export default new GenService();
  
  </code></pre>
  
  <p>But I can't figure out how to call firstName and lastName in backend java using spring boot</p>
  
  <p>SpringBootLd2nlApplication.java</p>
  
  <pre><code>package com.ld2nl.springbootld2nl;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.http.HttpStatus;
  import org.springframework.http.ResponseEntity;
  import org.springframework.web.bind.annotation.*;
  
  @SpringBootApplication
  @CrossOrigin(origins = { "http://localhost:3000", "http://localhost:4200" })
  @RestController
  
  public class SpringBootLd2nlApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(SpringBootLd2nlApplication.class, args);
      }
      //works
      @RequestMapping(value = "/")
      public String say() {
          return "Sending Hello To React";
      }
  
  //not work
      @RequestMapping(value = "/user")
      public String reply(@RequestParam String firstName) {
          return firstName;
      }
  
  }
  </code></pre>
  
  <p>As you can see  can't get the area marked as "//not work" to properly call firstName and lastName </p>
  
  <p>Currently giving error </p>
  
  <pre><code>Required String parameter 'firstName' is not present
  ....
  </code></pre>