protected void doPostForm(String path, MultivaluedMap<String, String> formParams, MultivaluedMap<String, String> headers) throws ClientException {
        this.readLock.lock();
        try {
            WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, HttpMethod.POST).getRequestBuilder();
            ensurePostFormHeaders(headers, requestBuilder, true, false);
            ClientResponse response = requestBuilder.post(ClientResponse.class);
            errorIfStatusNotEqualTo(response, ClientResponse.Status.OK, ClientResponse.Status.NO_CONTENT);
            response.close();
        } catch (ClientHandlerException ex) {
            throw new ClientException(ClientResponse.Status.INTERNAL_SERVER_ERROR, ex.getMessage());
        } finally {
            this.readLock.unlock();
        }
    }
protected void doPostForm ( String path , MultivaluedMap < String , String > formParams , MultivaluedMap < String , String > headers ) throws ClientException { this . readLock . lock ( ) ; try { WebResource . Builder requestBuilder = getResourceWrapper ( ) . rewritten ( path , HttpMethod . POST ) . getRequestBuilder ( ) ; ensurePostFormHeaders ( headers , requestBuilder , true , false ) ; ClientResponse response = requestBuilder . post ( ClientResponse . class ) ; errorIfStatusNotEqualTo ( response , ClientResponse . Status . OK , ClientResponse . Status . NO_CONTENT ) ; response . close ( ) ; } catch ( ClientHandlerException ex ) { throw new ClientException ( ClientResponse . Status . INTERNAL_SERVER_ERROR , ex . getMessage ( ) ) ; } finally { this . readLock . unlock ( ) ; } }
Submits a form.

@param path the API to call.
@param formParams the multi-part form content.
@param headers any headers to send. If no Content Type header is
specified, it adds a Content Type for form data.

@throws ClientException if a status code other than 200 (OK) and 204 (No
Content) is returned.