Installation
http://blog.csdn.net/wangwei_cq/article/details/9453345
Some of the basic parameters within the package
Http://www.cnblogs.com/manuosex/p/3583775.html
My use of the situation
13File Upload interface (Form form submission) function: Upload file to the server, then return the URL of the file, the last JPG representation type, if it is txt return the URL type is txt description: No login address: http://123.57.54.254:8090/api/values/postfileholeform/jpgmethod: Post request Type: No return type: {"Result": "TRUE", "Reason": "", "url": "Http://123.57.54.254/file/7AAD853A05E394EAC8E07654FE62DFD9.jpg"Well, the method is post, and the request type is none! Requestparams for nothing, so? iOS upload is a body object, the solution is Params.put ("File",Newfile (path), the request parameter "file" as the body client.post (URL, params,NewAsynchttpresponsehandler () {@Override Public voidOnsuccess (intStatusCode, header[] headers,byte[] responsebody) { Try { if(StatusCode = = 200) {Toast.maketext (userinfoheadactivity. This, "Avatar uploaded successfully!", 0). Show (); String Response=NewString (responsebody); Paresjsonwithgson (response); } Else{toast.maketext (userinfoheadactivity). This, "Network access exception, error code:" + StatusCode, 0). Show (); } } Catch(Exception e) {//TODO auto-generated Catch blockE.printstacktrace (); }} @Override Public voidOnFailure (intStatusCode, header[] headers,byte[] responsebody, throwable error) {Toast.maketext (userinfoheadactivity). This, "Network access exception, error code >" + StatusCode, 0). Show (); } });
Android-async-http