HttpClient httpClient = new DefaultHttpClient();
try {
HttpPost request = new HttpPost(strUrl);
StringEntity params =new StringEntity(json.toString(), "UTF-8");
//request.addHeader("content-type", "application/x-www-form-urlencoded");
params.setContentType("application/json");
request.setEntity(params);
HttpResponse response = httpClient.execute(request);
HttpEntity entity1 = response.getEntity();
is = entity1.getContent();
int resopnceStatus = response.getStatusLine().getStatusCode();
AppLog.logString(TAG + "get data resopnceStatus: " + resopnceStatus);
if (resopnceStatus != 200) {
return "Invalid";
}
}catch (IllegalArgumentException timeout) {
timeout.printStackTrace();
return "Invalid";
} catch (SocketTimeoutException timeout) {
timeout.printStackTrace();
return "Invalid";
} catch (Exception e) {
e.printStackTrace();
return "Invalid";
}
String response = "";
String s = "";
try {
BufferedReader buffer = new BufferedReader(new InputStreamReader(is));
while ((s = buffer.readLine()) != null) {
response += s;
}
} catch (Exception e) {
AppLog.logString(TAG + "get data Error in Buffered: " + e.toString());
e.printStackTrace();
}
AppLog.logString(TAG + "get data Return Data is: " + response);
Using above code in normal post rest web service it's working fine but in PATCH api its not working giving responce status 400 meance page not found but it's working fine in Chrome rest client. Any solution for PATCH?