2014-11-12 4 views

답변

0
public void async_post(){ 

//do a twiiter search with a http post 

String url = "http://search.twitter.com/search.json"; 

Map<String, Object> params = new HashMap<String, Object>(); 
params.put("q", "androidquery"); 

aq.ajax(url, params, JSONObject.class, new AjaxCallback<JSONObject>() { 

    @Override 
    public void callback(String url, JSONObject json, AjaxStatus status) { 

     showResult(json); 

    } 
}); 

}에서

+0

은, 내가 관심을 지불하지 않았다. 업로드하는 경우 해결책 : https://code.google.com/p/android-query/wiki/AsyncAPI#Http_POST_(Multipart) –

0
private void aync_multipart(){ 

    String url = "https://graph.facebook.com/me/photos"; 

    Map<String, Object> params = new HashMap<String, Object>(); 
    params.put("message", "Message"); 

    //Simply put a byte[] to the params, AQuery will detect it and treat it as a multi-part post 
    byte[] data = getImageData(); 
    params.put("source", data); 

    //Alternatively, put a File or InputStream instead of byte[] 
    //File file = getImageFile();   
    //params.put("source", file); 

    AQuery aq = new AQuery(getApplicationContext()); 
    aq.auth(handle).ajax(url, params, JSONObject.class, this, "photoCb"); 
} 

: 나는 그것을 표시 할 때 나는 당신의 대답에 대한 확신 아니에요 https://code.google.com/p/android-query/wiki/AsyncAPI#Http_POST_(Multipart)

관련 문제