title: Retrieving POST data using Java
body: <p>I'm trying to make a Java server that can accept and return data using POST. So far I have been trying to use nameValuePairs (although another method be fine) and have the server accepting connections, and accepting the HTTP header, but from here I cannot fathom how to get any attached data. The following code prints out the header and sends a 100 response once the client expects it - but how do I get the data from the message?</p>
  
  <pre><code>        while(true){
          inputLine = clientInput.readLine();
          System.out.println("client-msg: " + inputLine);
          if("Expect:".equals(inputLine.split(" ")[0])){
              sendResponse(100, "Continue");
              break;
          }
  </code></pre>
  
  <p>Here is what the (android java) client is sending, I'm looking to get the name pair out on the server side</p>
  
  <pre><code>            ArrayList&lt;NameValuePair&gt; postParams = new ArrayList&lt;NameValuePair&gt;();
          postParams.add(new BasicNameValuePair("field", "data here"));
          UrlEncodedFormEntity uefe = new UrlEncodedFormEntity(
                  postParams);
          request.setEntity(uefe);
          HttpResponse response = client.execute(request);
  </code></pre>
  
  <p>This is probably fairly simple but I couldn't seem to find any non PHP tutorials for POST.</p>