title: Whats the most RESTFul way to add resources?
body: <p>For example, if there is a rest api for a shop system to add articles to my shopping cart without knowing the id, what would be the most restful way to design the url to call and what about the serverside implementation? I know there is some flexibility when designing rest apis, but what is &quot;state of the art&quot;?</p>
  <p>Lets say my database does have the table &quot;articles&quot;, &quot;shoppingcarts&quot;, &quot;article_pos&quot;.
  articles (id, article_name, price, color),
  shoppingcarts (id, description),
  article_pos (id, <strong>shoppingcart_id</strong>, <strong>article_id</strong>)</p>
  <p>Example to create an article:</p>
  <p>POST &quot;/api/shop/article/&quot;
  Request:
  {
  &quot;article_name&quot;: &quot;table&quot;,
  &quot;price&quot;: &quot;100.00&quot;,
  &quot;color&quot;: &quot;brown&quot;
  }</p>
  <p>Example to get an existing article:</p>
  <p>GET &quot;/api/shop/article/4711&quot;
  Response:
  {
  &quot;id&quot;: &quot;4711&quot;,
  &quot;article_name&quot;: &quot;table&quot;,
  &quot;price&quot;: &quot;100.00&quot;,
  &quot;color&quot;: &quot;brown&quot;
  }</p>
  <p>But how I should design the url if I want to add article &quot;4711&quot; to the shopping cart?</p>
  <p>Like this?
  POST &quot;/api/shop/shoppingcart/addArticle/4711?amount=1&quot;</p>
  <p>or Like this?
  POST &quot;/api/shop/article_pos/&quot;
  Request:
  {
  &quot;shoppingcart_id&quot;: &quot;1&quot;,
  &quot;article_id&quot;: &quot;4711&quot;
  }</p>
  <p>And how to get the article ID if a client doesn't know the ID (4711) but the articlename (table)?</p>