title: Servlet equivalent in Python?
body: <p>On client side , following android code would make the call to the local server :</p>
  
  <pre><code>        String link = "http://localhost:8080/test/cgi-bin/test.py";
          URL url = null;
          try {
              url = new URL(link);
  
          HttpURLConnection client =  (HttpURLConnection) url.openConnection();
  
              JSONObject jo = new JSONObject();
              jo.put("desc","xyz");
  
              String data2 =  jo.toString();
              client.setRequestMethod("Post");
          //    client.setRequestProperty("key","value");
              client.setDoOutput(true);
  
              OutputStreamWriter outputPost = new OutputStreamWriter(client.getOutputStream());
              outputPost.write(data2);
              outputPost.flush();
              outputPost.close();
  </code></pre>
  
  <p>Earlier I was using servlets to interact with DB as the code below : 
  Using HttpServlet class , i could get the request and its parameters :</p>
  
  <pre><code>public class ServletXYZ extends HttpServlet {
  
   protected void processRequest(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
  
          String method = request.getParameter("method");
  </code></pre>
  
  <p>Is there any way in python which allows me to do the same (getting parameter values from request) ?</p>
  
  <p>Thanks.</p>