I'm working on a software-project for University, where we have to implement the client to a specific REST-service on Android. The REST-Post accepts two params:
- document (a XML document, in my code existing as a org.w3c.dom.Document created from a "TriageTag"-Object)
- timestamp (a string, representing the client's POST-time)
What I have so far:
[... timestamp / post url preparations etc. ...]
//Generate String from XML
InputSource is = new InputSource(c.getResources().openRawResource(R.raw.cda_template));
Document doc = CDAParser.TriageTagObjectToXml(tag, is);
//Data
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>
//FILL IN: SET DOC AS PARAM. WHO DO I DO THIS!?!?
nameValuePairs.add(new BasicNameValuePair("timestamp", timestamp));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
// Execute HTTP Post Request
HttpResponse response = client.execute(httppost);
StatusLine status = response.getStatusLine();
[... check status etc. ... ]