title: How to change request url before making request in scrapy?
body: <p>I need to modify my request url before a response is downloaded. But I'm not able to change it. Even after modifying the request url using <code>request.replace(url=new_url)</code>, the <code>process_response</code> prints the non-modified url. Here's the code of the middleware:</p>
  
  <pre><code>def process_request(self, request, spider):
      original_url = request.url
      new_url= original_url + "hello%20world"
      print request.url            # This prints the original request url
      request=request.replace(url=new_url)
      print request.url            # This prints the modified url
  
  def process_response(self, request, response, spider):
      print request.url            # This prints the original request url
      print response.url           # This prints the original request url
      return response
  </code></pre>
  
  <p>Can anyone please tell me what I'm missing here ?</p>