Code example for HttpPut

Methods: setEntitysetHeader

        if (Utils.isEmpty(putBody)) {
            throw new IllegalArgumentException("Put body must not be null or empty to run PUT request.");
        HttpPut httpPut = new HttpPut(url);
        //TODO: make this support non-JSON types. 
        httpPut.setHeader("Content-type", "application/json");
        ByteArrayEntity putEntity;
        try { 
            putEntity = new ByteArrayEntity(putBody.getBytes("UTF-8"));
        } catch (UnsupportedEncodingException e) {
            throw new HttpUtilsException("Unsupported encoding for PUT body.", e);
        return httpPut;
    /* (non-Javadoc) 
Connect your IDE to all the code out there  Get Codota for Java