private Response writeResource ( final String method , final String body ) throws IOException { buildQueryString ( ) ; buildHeaders ( ) ; connection . setDoOutput ( true ) ; connection . setRequestMethod ( method ) ; writer = new OutputStreamWriter ( connection . getOutputStream ( ) ) ; writer . write ( body ) ; writer . close ( ) ; return readResponse ( ) ; }
A private method that handles issuing POST and PUT requests