Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(6)  |  Derive(0)  |  Import(0)
Returns the header that matches the name via case-insensitive matching.
If the header does not exist, a new header is created, attached to the
message and returned. If the header already exists, then it is
returned.

src/p/y/pyrox-0.4.5/tests/http/model_test.py   pyrox(Download)
    def test_return_true_when_removing_existing_header(self):
        http_msg = HttpMessage()
        http_msg.header('test')
        self.assertTrue(http_msg.remove_header('test'))
 
    def test_return_empty_header_object_when_header_does_not_exist(self):
        http_msg = HttpMessage()
        header = http_msg.header('test')
    def test_return_header_when_header_exists(self):
        http_msg = HttpMessage()
        http_msg.header('test')
 
        header = http_msg.get_header('test')

src/p/y/pyrox-HEAD/tests/http/model_test.py   pyrox(Download)
    def test_return_true_when_removing_existing_header(self):
        http_msg = HttpMessage()
        http_msg.header('test')
        self.assertTrue(http_msg.remove_header('test'))
 
    def test_return_empty_header_object_when_header_does_not_exist(self):
        http_msg = HttpMessage()
        header = http_msg.header('test')
    def test_return_header_when_header_exists(self):
        http_msg = HttpMessage()
        http_msg.header('test')
 
        header = http_msg.get_header('test')