次のような URL でデータを送信する必要があります。
http://webservices.fecth.es/school/message/sendmessage/ id / myStringId /宛先/ myStringDestination / msg / myMessage
私は文字列に必要なデータを持っていますが、ポストメソッドを介してこれを送信するのではなく、このコードをテストしましたが機能しません:
String postURL = "http://webservices.fecth.es/school/message/sendmessage/";
HttpPost post = new HttpPost(postURL);
List<NameValuePair> param = new ArrayList<NameValuePair>();
param.add(new BasicNameValuePair("id", myId));
param.add(new BasicNameValuePair("destination", myStringDestination));
param.add(new BasicNameValuePair("msg", myMessage));
UrlEncodedFormEntity ent = new UrlEncodedFormEntity(param,HTTP.ISO_8859_1);
post.setEntity(ent);
HttpResponse responsePOST = client.execute(post);
HttpEntity resEntity = responsePOST.getEntity();
彼らは私の問題を解決してくれますか?
どうもありがとう