Code example for FileEntity

0
	    HttpPost httpPost = new HttpPost(url);
	    HttpResponse response = null;
 
	    FileEntity tmp = null;       
 
	    tmp = new FileEntity(data,"UTF-8");
 
	    httpPost.setEntity(tmp);
 
	    try { 
	        response = httpclient.execute(httpPost);
	    } catch (ClientProtocolException e) {
	    	Log.e("WATCHER", "HTTPHelp : ClientProtocolException : "+e);
	    } catch (IOException e) {
	    	Log.e("WATCHER", "HTTPHelp : IOException : "+e);
	    } 
 
        return response.getStatusLine().getStatusCode();
	} 
} 
Experience pair programming with AI  Get Codota for Java