title: python https server post
body: <p>I am trying to comeup with a http server which replies for a POST request from the client. The python code is returning http code 000 instead of 200/100. Plz let me know if there is any issue in the code</p>
  
  <h1>CURL request returns 000 instead of 200/100</h1>
  
  <p>curl -s -o /dev/null -I -w "%{http_code}" -X POST <a href="https://10.1.4.179:443/xml" rel="nofollow noreferrer">https://10.1.4.179:443/xml</a>  -k
  000</p>
  
  <h1>CODE:</h1>
  
  <pre><code>import BaseHTTPServer, SimpleHTTPServer
  import ssl
  import logging
  
  class GetHandler (SimpleHTTPServer.SimpleHTTPRequestHandler):
  
          def do_GET(self):
                  logging.error(self.headers)
                  SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)
  
          def do_POST(self):
                  self.wfile.write("&lt;html&gt;&lt;body&gt;&lt;h1&gt;POST!&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;")
  
  Handler= GetHandler
  
  logging.basicConfig(level=logging.DEBUG)
  httpd=BaseHTTPServer.HTTPServer(("10.1.4.179", 443), Handler)
  httpd.socket =ssl.wrap_socket(httpd.socket, certfile='/tftpboot/server.pem', server_side=True)
  httpd.serve_forever()
  </code></pre>