title: Spring Rest 400 Bad Request
body: <p>I m getting 400 Bad Request but i have no idea why. It seems everything fine to me. I would appreciate some ideas..</p>
  
  <pre><code>@Component
  public class TicketIdentifierRestClient implements TicketIdentifierService{
  @Autowired
  private RestClient restClient;
  
  @Override
  public List&lt;TicketIdentifierDto&gt; createTicketIdentifier(List&lt;TicketIdentifierDto&gt; list)
          throws ServiceException {
  
      RestTemplate restTemplate = this.restClient.getRestTemplate();
      String url = this.restClient.createServiceUrl("/ticketIdentifier/");
  
      HttpHeaders headers = this.restClient.getHttpHeaders();
      headers.setContentType(MediaType.APPLICATION_JSON);
      headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON))
      ;
      HttpEntity&lt;String&gt; entity = new HttpEntity&lt;String&gt;(headers);
      List&lt;TicketIdentifierDto&gt; tickets = null;
  //  System.out.println("necati"+list.get(0).toString());
      try {
          ParameterizedTypeReference&lt;List&lt;TicketIdentifierDto&gt;&gt; ref = new ParameterizedTypeReference&lt;List&lt;TicketIdentifierDto&gt;&gt;() {};
          ResponseEntity&lt;List&lt;TicketIdentifierDto&gt;&gt; response = restTemplate.exchange(URI.create(url), HttpMethod.POST, entity,ref);
          tickets = response.getBody();
          return tickets;
  
      } catch (RestClientException e) {
          e.printStackTrace();
          throw new ServiceException("Could not retrieve tickets: " + e.getMessage(), e);
  
      }
  }
  </code></pre>
  
  <p>and the server side i m just trying to get the list and print it out here</p>
  
  <pre><code>@RestController
  @RequestMapping(value = "/ticketIdentifier")
  public class TicketIdentifierController {
  private  final Logger LOG = Logger.getLogger(TicketController.class);
  @Autowired
  private TicketIdentifierService tiService;
  
  @RequestMapping(method = RequestMethod.POST, consumes = "application/json", produces = "application/json")
  public @ResponseBody List&lt;TicketIdentifierDto&gt; getTickets(@RequestBody List&lt;TicketIdentifierDto&gt; list) throws ServiceException {
      System.out.println("did i get it ?"+list.get(0).toString());
      //return EntityToDto.convertTicketIdentifiers(tiService.create(list));
      return list;
  }
  }
  </code></pre>