Code example for HttpPost

Methods: setHeader

        callMethod(post, operation);
    public void delete(String feedUrl, Operation operation) throws IOException {
        HttpPost post = new HttpPost(feedUrl);
        String etag = operation.inOutEtag;
        post.setHeader(X_HTTP_METHOD_OVERRIDE, "DELETE");
        post.setHeader(IF_MATCH, etag != null ? etag : "*");
        callMethod(post, operation);
    private void callMethod(HttpUriRequest request, Operation operation) throws IOException {
        try { 
            // Specify GData protocol version 2.0. 
            request.addHeader("GData-Version", "2");
            // Indicate support for gzip-compressed responses. 
            request.addHeader("Accept-Encoding", "gzip");
Connect your IDE to all the code out there  Get Codota for Java