title: How make request GET in angular?
body: <p>i need request GET from angular to spring java, but i get  error <strong>415</strong></p>
  
  <pre><code>zone.js:3243 GET http://localhost:8080/user/friend/1 415
  </code></pre>
  
  <p>this is my code in spring java to the endpoint </p>
  
  <pre><code> @RequestMapping(
              value = "/friend/{idUser}",
              method = RequestMethod.GET,
              consumes = "application/json",
              produces = "application/json")
      public ResponseEntity&lt;List&lt;Friendship&gt;&gt; getFriend(@PathVariable Long idUser) {
          return new ResponseEntity&lt;List&lt;Friendship&gt;&gt;(userServiceImpl.getFriends(idUser), HttpStatus.OK);
      }
  </code></pre>
  
  <p>and this is my code in angular, to request the data from backend</p>
  
  <pre><code>getFriends(idUser) {
          console.log('UNA', idUser);
          const config = new HttpHeaders().set('Content-Type', 'application/json');
          const url = 'http://localhost:8080/user/friend/' + idUser;
          const body = JSON.stringify({"idOwner": idUser});
          return this.http.get&lt;Object[]&gt;(url);
      }
  </code></pre>