Response put ( URI uri , InputStream instream , String contentType ) { HttpResponse response = null ; try { final HttpPut httpPut = new HttpPut ( uri ) ; final InputStreamEntity entity = new InputStreamEntity ( instream , - 1 ) ; entity . setContentType ( contentType ) ; httpPut . setEntity ( entity ) ; response = executeRequest ( httpPut ) ; return getResponse ( response ) ; } finally { close ( response ) ; } }
Performs a HTTP PUT request saves an attachment .