'The request body of a I{POST} request with a I{Content-Type} header
of I{application/x-www-form-urlencoded} is parsed according to that
content type and made available in the C{args} attribute of the
request object.  The original bytes of the request may still be read
from the C{content} attribute.'

def test_formPOSTRequest(self):

    query = 'key=value&multiple=two+words&multiple=more%20words&empty='
    httpRequest = networkString(('POST    /    HTTP/1.0\nContent-Length:    %d\nContent-Type:    application/x-www-form-urlencoded\n\n%s' % (len(query), query)))
    method = []
    args = []
    content = []
    testcase = self
    class MyRequest(http.Request, ):
        def process(self):
            method.append(self.method)
            args.extend([self.args['key'], self.args['empty'], self.args['multiple']])
            content.append(self.content.read())
            testcase.didRequest = True
            self.finish()
    self.runRequest(httpRequest, MyRequest)
    self.assertEqual(method, ['POST'])
    self.assertEqual(args, [['value'], [''], ['two    words', 'more    words']])
    self.assertEqual(content, [networkString(query)])
