title: Spring Data REST - add item to associated collection
body: <p>I'm trying to figure out how to add an item to an associated collection using Spring Data Rest.</p>
  
  <p>According to the <a href="http://docs.spring.io/spring-data/rest/docs/current/reference/html/#repository-resources.association-resource" rel="nofollow">Spring Data REST documentation</a>, POST method is supported for collections, so </p>
  
  <pre><code>  curl -i -X POST -H 'Content-type: text/uri-list' -d 'http://localhost:8080/artifacts/1' http://localhost:8080/collectors/1/artifacts
  </code></pre>
  
  <p>should add an artifact to the (yet empty) collection. Unfortunately, it does not:</p>
  
  <pre><code>HTTP/1.1 405 Method Not Allowed
  Server: Apache-Coyote/1.1
  Allow: GET, DELETE, PATCH, PUT
  Content-Type: application/json;charset=UTF-8
  Transfer-Encoding: chunked
  Date: Fri, 17 Apr 2015 22:54:59 GMT
  
  {"timestamp":1429311299117,"status":405,"error":"Method Not Allowed","exception":"org.springframework.web.HttpRequestMethodNotSupportedException","message":"Request method 'POST' not supported","path":"/collectors/1/artifacts"}
  </code></pre>
  
  <p>My entities:</p>
  
  <pre><code>@Data
  @Entity
  public class Collector {
      @Id
      @GeneratedValue
      private Long id;
  
      private String name;
  
      @OneToMany(mappedBy = "owner")
      private List&lt;Artifact&gt; artifacts;
  }
  
  @Data
  @Entity
  @Accessors(chain = true, fluent = true)
  public class Artifact {
  
      @Id
      @GeneratedValue
      private Long id;
  
      private String title;
  
      @ManyToOne
      @JoinColumn(name = "collector_id")
      private Collector owner;
  }
  </code></pre>
  
  <p>The complete code is on <a href="https://github.com/endrec/associated-collection-test" rel="nofollow">Github</a>.</p>
  
  <p>What did I do wrong?</p>