I am using the AndroidQuery (AQuery) library for Android, and I need to create a PUT request with the StringEntity entity (some string).
My code, what's wrong? Your suggestions? I tried using without ".header (" _ method "," PUT ")"
HttpEntity entity = null; try { entity = new StringEntity(stringData, HTTP.UTF_8); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } Map<String, Object> params = new HashMap<String, Object>(); params.put(AQuery.POST_ENTITY, entity); AQuery aq = new AQuery(this); aq.progress(pDialog).ajax(url, params, String.class, new AjaxCallback<String>() { @Override public void callback(String url, String json, AjaxStatus status) { if(status.getCode() == 200) { } else { } } }.header("Content-Type", "application/x-www-form-urlencoded") .header("_method", "PUT"));
source share