title: Error 405: Method not Allowed on POST method
body: <p>I try to pass an object to my backend (spring boot), but it doesn't work.
  I have other post method and they work. I don't understand what I am missing.</p>
  <p>error:</p>
  <pre><code>XNIO-1 task-1] o.z.problem.spring.common.AdviceTraits   : Method Not Allowed: Request method 'POST' not supported
  </code></pre>
  <p>Front-end (angular):</p>
  <p>service:</p>
  <pre><code>  create(report: IReport): Observable&lt;HttpResponse&lt;any&gt;&gt; {
      return this.http.post&lt;IReport&gt;(this.resourceUrl, report, { observe: 'response' });
    }
  </code></pre>
  <p>Model:</p>
  <pre><code>export class Report implements IReport {
    constructor(
      public companiesId?: number[],
      public jobsId?: number[],
      public customersId?: number[],
      public usersId?: number[],
      public dates?: Moment[],
      public projectsId?: number[]
    ) {}
  </code></pre>
  <p>Backend:</p>
  <p>controller:</p>
  <pre><code>@RestController
  @RequestMapping(&quot;/api&quot;)
  public class ReportRessource {
      private final Logger log = LoggerFactory.getLogger(ReportRessource.class);
  
      @Value(&quot;${jhipster.clientApp.name}&quot;)
      private String applicationName;
  
      private static final String NAME = &quot;report&quot;;
  
      private ReportService reportService;
  
      public ReportRessource(ReportService reportService) {
          this.reportService = reportService;
      }
  </code></pre>
  <p>...</p>
  <pre><code>@PostMapping(&quot;/report}&quot;)
  @PreAuthorize(
      &quot;hasAnyAuthority(\&quot;&quot; +
      AuthoritiesConstants.ADMIN +
      &quot;\&quot;+\&quot;,&quot; +
      AuthoritiesConstants.CUSTOMER_ADMIN +
      &quot;\&quot;+\&quot;,&quot; +
      AuthoritiesConstants.INSPECTOR +
      &quot;\&quot;)&quot;
  )
  
  public ResponseEntity&lt;Boolean&gt; createFullReport( @RequestBody ReportDTO report) throws URISyntaxException, IOException {
  log.debug(&quot;REPORTDTO : {}&quot;, report);
  
  this.reportService.makeFullReport(report);
  return ResponseEntity
      .noContent()
      .headers(HeaderUtil.createEntityCreationAlert(applicationName, true, NAME, report.toString()))
      .build();
  </code></pre>
  <p>}</p>
  <p>ReportDTO:</p>
  <pre><code>import java.time.LocalDate;
  import java.util.HashSet;
  import java.util.Set;
  
  public class ReportDTO {
      private Set&lt;Long&gt; companiesId = new HashSet&lt;&gt;();
      private Set&lt;Long&gt; jobsId = new HashSet&lt;&gt;();
      private Set&lt;Long&gt; customersId = new HashSet&lt;&gt;();
      private Set&lt;Long&gt; usersId = new HashSet&lt;&gt;();
      private Set&lt;LocalDate&gt; dates = new HashSet&lt;&gt;();
      private Set&lt;Long&gt; projectsId = new HashSet&lt;&gt;();
  
      public ReportDTO() {
          // Empty constructor needed for Jackson.
      }
  </code></pre>
  <p>I don't now where should I search. Any idea?
  Thank you!</p>
  <p>EDIT:</p>
  <p>Problem =&gt; &quot;report}&quot; should be &quot;report&quot;</p>