title: How to generate POST and GET request by python twisted HTTPClient?
body: <p>I am writing an HTTP Client. It is a simple mock bank site. It needs to be able to send two kinds of request out:</p>
  
  <ol>
  <li>When user login:
  POST /login?user=bob&amp;pass=abc123 
  HTTP/1.1 
  Host:  bank.com</li>
  <li>When the user transfers money:
  GET /transfer?to=badguy&amp;amt=100 
  HTTP/1.1 
  Host:  bank.com
  Cookie: login=fde874</li>
  </ol>
  
  <p>I am implementing it by python twisted, I write a subclass of HTTPClient:</p>
  
  <pre><code>class BankClient(HTTPClient):
      def genReq():
         # How to write code to generate and send the Two request?
  
      def connectionMode(self):
          genReq()
  
  
  
  class BankCllientFactory(ClientFactory):
      protocol = BankClient
      def __init__(self):
         self.done = Defered()
  
  
  def main(reactor):
     factory= BankClientFactory()
     reactor.connectTCP('localhost',8080,factory)
     return factory.done
  if __name__ =='__main__':
      task.react(main)
  
  </code></pre>