@Override
    public InputStream post(String url, String content, HashMap<String, String> headers, String userName, String password, String domain) throws Exception {
        Registry<AuthSchemeProvider> authSchemeRegistry = RegistryBuilder.<AuthSchemeProvider>create()
                .register(AuthSchemes.NTLM, new JCIFSNTLMSchemeFactory())
                .register(AuthSchemes.BASIC, new BasicSchemeFactory())
                .register(AuthSchemes.DIGEST, new DigestSchemeFactory())
                .register(AuthSchemes.SPNEGO, new SPNegoSchemeFactory())
                .register(AuthSchemes.KERBEROS, new KerberosSchemeFactory())
                .build();

        CredentialsProvider credsProvider = new BasicCredentialsProvider();
        credsProvider.setCredentials(AuthScope.ANY, new NTCredentials(userName, password, "", domain));

        HttpClientContext context = HttpClientContext.create();
        context.setCredentialsProvider(credsProvider);

        CloseableHttpClient httpClient = HttpClients.custom()
                .setDefaultAuthSchemeRegistry(authSchemeRegistry)
                .build();

        HttpPost post = new HttpPost(url);
        HttpEntity entity = new StringEntity(content, "utf-8");
        post.setEntity(entity);
        if (headers != null && headers.size() > 0) {
            for (String name : headers.keySet()) {
                post.addHeader(name, headers.get(name));
            }
        }

        if (content != null && content.contains("<soap12:Body>"))
            System.out.printf("Request url: %s > %s%n", url, getAction(content));
        else
            System.out.printf("Request url: %s%n", url);

        HttpResponse response = httpClient.execute(post, context);

        StatusLine statusLine = response.getStatusLine();
        switch (statusLine.getStatusCode()) {
            case 200:
                break;
            default:
                throw new HttpResponseException(statusLine.getStatusCode(), statusLine.getReasonPhrase());
        }

        return response.getEntity().getContent();
    }