I have a website which was created with cakephp. I want to pass some values formed in my App to this website. When I enter the exact same URL in the browser it works.
The URL is something like: www.something.com/function/add/value
So I'm very confused if this is a GET or a POST method? And how I can do that?
The thing is that I can NOT change this URL or put some POST or GET PHP script there to get the values. So I basically just have to call the URL with those params.
This is my code:
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = null;
try {
httppost = new HttpPost("www.something.com/function/add/" + URLEncoder.encode(txtMessage.getText().toString(), "UTF-8"));
} catch (UnsupportedEncodingException e1) {
e1.printStackTrace();
}
try {
ResponseHandler<String> responseHandler = new BasicResponseHandler();
httpclient.execute(httppost, responseHandler);
} catch (ClientProtocolException e) {
} catch (IOException e) {
}