title: Django: Search via GET request, POST request or in the URL?
body: <p>I am implementing a search form in Django. I can do a POST or a GET request. Each has their use-cases (POST request, if I want to change data on the server, GET request, if I just want to get data from the server). </p>
  
  <ul>
  <li>Via POST request (the search keywords are not visiable in the URL, but rather in a dict in request.POST); cons: I cannot bookmark the search</li>
  <li>via GET request (the search keywords are visible in the URL, for intance <code>localhost:8000/books/?author=schultz</code>); cons(?): the part <code>?author=schultz</code> cannot be processed by the URL handler (see [2] below). I need to read the data from <code>request.GET.get("author", None)</code> in my view function.</li>
  <li>or directly in the URL like so: <code>localhost:8000/books/search/author/schultz</code> ?</li>
  </ul>
  
  <p>The author in [1] says, that Django's preferred way to handle a URL is not via GET (like so: <code>/category_check_view/?item_id=2</code>, but rather like so <code>/category_check_view/2</code>)</p>
  
  <p>If I would like to implement search like this: <code>localhost:8000/books/author/schultz</code>, then I would have to process a GET request, read the params <code>?author=schultz</code> via <code>request.GET.get("author", None)</code> and in my view do a redirect from this URL <code>localhost:8000/books</code> (in which I have a form and a GET request) to this <code>localhost:8000/books/author/schultz</code>.</p>
  
  <p>Does this approach make sense? Or am I overcomplicating things? Just leave it at a GET request to implement my search form?</p>
  
  <hr>
  
  <p>[1] <a href="https://stackoverflow.com/users/24545/yuval-adam">Yuval Adam</a> says in <a href="https://stackoverflow.com/a/8398231/5115219">this post</a> that </p>
  
  <blockquote>
    <p>GET params are not processed by the URL handler, but rather passed
    directly to the GET param dict accessible in a view at request.GET.</p>
    
    <p>The Django (i.e. preferred) way to do handle URLs is the first one.</p>
  </blockquote>
  
  <p>[2] <a href="https://docs.djangoproject.com/en/1.11/topics/http/urls/#what-the-urlconf-searches-against" rel="nofollow noreferrer">Django docs: What the URLconf searches against</a></p>