title: How to search for books that have spaces in their title using Google books API
body: <p>When i search for books with a single name(e.g bluets) my code works fine, but when I search for books that have two names or spaces (e.g white whale) I got an error(jinja2 synatx) how do I solve this error?</p>
  <pre><code>   @app.route(&quot;/book&quot;, methods[&quot;GET&quot;, &quot;POST&quot;])
     def get_books():
      api_key = 
      os.environ.get(&quot;API_KEY&quot;) 
      if request.method == &quot;POST&quot;:
       book = request.form.get(&quot;book&quot;)    
       url =f&quot;https://www.googleapis.com/books/v1/volumes?q={book}:keyes&amp;key={api_key}&quot; 
       response =urllib.request.urlopen(url) 
       data = response.read() 
       jsondata = json.loads(data) 
      return render_template (&quot;book.html&quot;, books=jsondata[&quot;items&quot;]
  </code></pre>
  <p>I tried to search for similar cases, and just found one solution, but I didn't understand it
  Here is my error message
  http.client.InvalidURL</p>
  <p>http.client.InvalidURL: URL can't contain control characters. '/books/v1/volumes?q=white whale:keyes&amp;key=AIzaSyDtjvhKOniHFwkIcz7-720bgtnubagFxS8' (found at least ' ')</p>