mirror of https://github.com/scrapy/scrapy.git
Added webclient test for checking Content-Length header in response for POST request with no given body
This commit is contained in:
parent
c81eefaf81
commit
1b6d5a011a
|
|
@ -132,6 +132,18 @@ class ScrapyHTTPPageGetterTests(unittest.TestCase):
|
|||
"\r\n"
|
||||
"name=value")
|
||||
|
||||
# test a POST method with no body provided
|
||||
factory = client.ScrapyHTTPClientFactory(Request(
|
||||
method='POST',
|
||||
url='http://foo/bar'
|
||||
))
|
||||
|
||||
self._test(factory,
|
||||
"POST /bar HTTP/1.0\r\n"
|
||||
"Host: foo\r\n"
|
||||
"Content-Length: 0\r\n"
|
||||
"\r\n")
|
||||
|
||||
# test with single and multivalued headers
|
||||
factory = client.ScrapyHTTPClientFactory(Request(
|
||||
url='http://foo/bar',
|
||||
|
|
|
|||
Loading…
Reference in New Issue