scrapy/scrapy — pull request #412 by mquandalle (2013-10-03 21:26:51+00:00)
Title: Add the overwrite parameter to the FormRequest constructor

I find myself using a lot this pattern inside a callback function (I've fetched the first page of the search, all the search parameters are in the url, and I want to fetch the other pages):

```py
for page in xrange(2, NB_PAGES):
yield FormRequest(
url = response.url,
method = "GET",
callback = self.parse_page,
data = {'page': page})
```

The problem is that if the `page` parameter is already present in the url, I'd like to overwrite it. This is what this PR allows me to do.

```py
FormRequest("http://website.com?a=1&b=1", method = "GET", formdata = {"b":"2", "c":"3"})
>>> "http://website.com?a=1&b=2&c=3"

FormRequest("http://website.com?a=1&b=1", method = "GET", formdata = {"b":"2", "c":"3"}, overwrite = False)
>>> "http://website.com?a=1&b=1&b=2&c=3"
```

It also allows to destroy parameters in url with the `None` value.

```py
FormRequest("http://website.com?a=1&b=1", method = "GET", formdata = {"a":None, "c":"3"})
>>> "http://website.com?b=1&c=3"
```

Please tell me what you think of this proposition.