0
我試圖上傳採用Android API(Link)亞馬遜雲硬盤API節點API
我使用AsyncHttpclient文件到亞馬遜雲驅動器。 下面是我嘗試過的代碼,但我沒有成功運行,我想知道什麼是正確的參數和標題設置之前作出發佈請求。
我已經登錄並擁有令牌。
AsyncHttpClient cli = new AsyncHttpClient();
RequestParams params = new RequestParams();
params.put("kind","file");
params.put("name","img.jpg");
try{
params.put("file",new file(/sdcard/img));
}
catch(Exception e){
}
// other Request param to go here
chi.addHeader("Authorization: Bearer",authzToken);
chi.("content-na.drive.amazonaws.com/cdproxy/nodes", param,
new AsyncHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
Log.e("TaGGGGGGGGGGGGGGGG", "" + statusCode);
// Toast.makeText(getApplicationContext(), "Not Possible", Toast.LENGTH_SHORT).show();
}
@Override
public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {
}
});
謝謝,但幾行代碼將非常有用,如發送請求之前的參數列表(Requestparams)。 –