title: Spring - two different POST methods with the same URL but different produced content type
body: <p>I have the following controller:</p>
  
  <pre><code>@RequiredArgsConstructor
  @RestController
  public class OwnerViewController implements ApiOwnerViewController {
  
      private static final String TEXT_CSV = "text/csv";
  
      private final PrivateOwnerFacade privateOwnerFacade;
  
      @PostMapping("/boat/v1/private-owners/search")
      public OwnerViewResponse searchOwners(@Valid @RequestBody SearchOwnersRequest request,
                                            Pageable pageable) {
          return privateOwnerFacade.findOwners(request, pageable);
      }
  
      @PostMapping(value = "/boat/v1/private-owners/search", produces = TEXT_CSV)
      public ResponseEntity&lt;Resource&gt; exportToCsv(@Valid @RequestBody SearchOwnersRequest request, Pageable pageable)
              throws IOException {
  </code></pre>
  
  <p>So I have two methods mapped to the same url and that both accept POST request BUT produce different content type - the first one produces <code>application/json</code> while the second produces <code>text/csv</code>.</p>
  
  <p>Then, when I'm trying to make a request and set header
  <code>Accept: text/csv</code> I get 406 from the server.</p>
  
  <p>I wonder if it is really possible to do such things with spring? Or is the only way to change second method so that it accepts <code>GET</code> requests?</p>
  
  <p>Thanks</p>