public Response httpsRequest(String url, PostParameter[] params, boolean authenticated, String method) throws TBlogException {

        Response response = null;
        Protocol.registerProtocol("https", new Protocol("https", new MySSLSocketFactory(), 443));
        org.apache.commons.httpclient.HttpClient httpclient = new org.apache.commons.httpclient.HttpClient();

        if ("GET".equals(method)) {

            GetMethod get = new GetMethod(url);

            if (authenticated) {
                get.addRequestHeader("Authorization", "OAuth2 " + this.oauth2AccessToken);
            }

            try {
                httpclient.executeMethod(get);
                response = new Response(get);
            } catch (HttpException e) {
                throw new TBlogException(e.getMessage(), e);
            } catch (IOException e) {
                throw new TBlogException(e.getMessage(), e);
            }

        } else if ("POST".equals(method)) {

            UTF8PostMethod post = new UTF8PostMethod(url);
            for (PostParameter p : params) {
                post.addParameter(p.getName(), p.getValue());
            }
            if (authenticated) {
                post.addRequestHeader("Authorization", "OAuth2 " + this.oauth2AccessToken);
            }

            try {
                httpclient.executeMethod(post);
                response = new Response(post);
            } catch (HttpException e) {
                throw new TBlogException(e.getMessage(), e);
            } catch (IOException e) {
                throw new TBlogException(e.getMessage(), e);
            }
        }
        return response;
    }