title: GET and POST between a UWP Application and an HTTP Server
body: <p>I've just recently started trying to setup an HTTP server with Python on my computer to try to communicate with a UWP application that I'm building. My overall goal is to host this server online and send photos from the UWP application to the HTTP server and then run a Python/C++ script on the images. Once that has finished processing, I want to output some data into a file and then send that back to the UWP application. I'm new to servers and databases and so I'm not quite sure where to go from here.</p>
  <p>As I mentioned, I've set up a very basic server with the following Python code:</p>
  <pre><code>from http.server import BaseHTTPRequestHandler, HTTPServer
  import time
  
  hostName = &quot;localhost&quot;
  serverPort = 8080
  
  class MyServer(BaseHTTPRequestHandler):
      def do_GET(self):
  
  
  self.send_response(200)
      self.send_header(&quot;Content-type&quot;, &quot;text/html&quot;)
      self.end_headers()
      self.wfile.write(bytes(&quot;&lt;p&gt;Request: %s&lt;/p&gt;&quot; % self.path, &quot;utf-8&quot;))
      if(self.path == &quot;/test&quot;):
          exec(open(&quot;test.py&quot;).read())
  
  def do_POST(self):
      content_length = int(self.headers['Content-Length']) # &lt;--- Gets the size of data
      post_data = self.rfile.read(content_length) # &lt;--- Gets the data itself
  
      self.send_response(200)
      self.send_header('Content-type', 'text/html')
      self.end_headers()
      self.wfile.write(&quot;POST request for {}&quot;.format(self.path).encode('utf-8'))
  
  
  if __name__ == &quot;__main__&quot;:        
      webServer = HTTPServer((hostName, serverPort), MyServer)
      print(&quot;Server started http://%s:%s&quot; % (hostName, serverPort))
  
      try:
          webServer.serve_forever()
      except KeyboardInterrupt:
          print(&quot;Server stopped.&quot;)
          webServer.server_close()
  </code></pre>
  <p>And I am able to successfully GET and POST but now I'm not sure what to do. Do I need to setup a database to store any of the data that I post? If so, what's the best way to go about that?</p>
  <p>Any help would be greatly appreciated!</p>