我正在为大学开发一个软件项目,我们必须在Android上将客户端实现为特定的REST服务。 REST-Post接受两个参数:
到目前为止我所拥有的:
[... 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. ... ]