, - RESTful. - RESTful . ... , JSON ... , JSON XML, HTTP-.. :
httpConnection = new HTTPConnectionManager(request);
HttpURLConnection httpURLConnection = httpConnection.connect();
int responseCode = httpURLConnection.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) {
in = httpURLConnection.getInputStream();
int x;
StringBuilder stringBuilder = new StringBuilder();
while ((x = in.read()) != -1) {
stringBuilder.append((char) x);
}
XMLParser xmParser = new XMLParser();
....
....
}
XML -. StringBuilder, XML. - JSON. javaJSON API, , JSON.
...
PS: HTTPConnectionManager, XMLParserand Request( Requestobject) classes are not standard API. they are written by my account to handle multiple web service calls. This piece of code is intended only to give you my idea.
source
share