java - Android: cannot instantiate the type httpclient -
i getting error next line of code
httpclient client= new httpclient, event have add together httpclient-4.2.3.jar project.
i have tried rewriting httpclient client= new defaulthttpclient. solves problem , creates new error other methods (in executemethod()).
this code :
public static string postupload(string url, string foto){ inputstream inputstream=null; string result=""; httpclient httpclient = new httpclient(); postmethod method = new postmethod(url); //set json ke hhtp post entity // file file_foto= new file(foto); // fileentity fe_foto=new fileentity(file_foto, "image/jpeg"); method.setrequestentity(new filerequestentity(new file(foto), "multipart/form-data")); // se.setcontenttype("application/json;charset=utf-8"); // httppost.setheader("accept", "application/json"); seek { int status = httpclient.executemethod(method); system.out.println("http status " + method.getstatuscode() + " creating con\n\n"); } grab (clientprotocolexception e) { e.printstacktrace(); } grab (ioexception e) { e.printstacktrace(); // todo auto-generated grab block }finally { method.releaseconnection(); } } is there know why happen? please help
java android httpclient
No comments:
Post a Comment