title: What is the difference between @RequestMapping and @PostMapping
body: <p>in the below example, I am trying to undersatnd the difference between @RequestMapping and @PostMapping. 
  For @RequestMapping:</p>
  
  <p>when i do the POST request: 
      <a href="http://localhost:8085/call1/initparam1?val=1111" rel="noreferrer">http://localhost:8085/call1/initparam1?val=1111</a> via postman, it executes correctly.
  but when its is proceeded by by GET request<br>
      <a href="http://localhost:8085/call1/getparam1" rel="noreferrer">http://localhost:8085/call1/getparam1</a>   </p>
  
  <p>i do not get 1111 as a result.</p>
  
  <p>For @PostMapping, when i do the POST request: 
      <a href="http://localhost:8085/call1/initparam2/1999" rel="noreferrer">http://localhost:8085/call1/initparam2/1999</a> via postman, it executes correctly.
  but when its is proceeded by by GET request<br>
      <a href="http://localhost:8085/call1/getparam1" rel="noreferrer">http://localhost:8085/call1/getparam1</a>   </p>
  
  <p>i do not get 1999 as a result.</p>
  
  <p>please explain to me what is the difference between using both annotations, as i spent time googling and researching but i could not figure out why the first example is not working.</p>
  
  <p><strong>Controller1</strong></p>
  
  <pre><code>@Controller
  @ResponseBody
  @RequestMapping("/call1")
  public class Call1 {
  
  public String str = "inti";
  
  @RequestMapping(value = "/initparam1", method = RequestMethod.POST)
  public void initparam1(@RequestParam(value = "val") String val) {
      this.str = val;
  }
  
  @PostMapping(value = "/initparam2/{val}")
  public void initparam2(@PathVariable String val) {
      this.str = val;
  }
  
  @RequestMapping("/getparam1")
  @ResponseBody
  public String getParam1() {
      return this.str;
  }
  }
  </code></pre>