All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.spincast.plugins.httpclient.IRequestBuilderBase Maven / Gradle / Ivy

There is a newer version: 0.9.21
Show newest version
package org.spincast.plugins.httpclient;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.spincast.core.cookies.ICookie;
import org.spincast.shaded.org.apache.http.client.config.RequestConfig;
import org.spincast.shaded.org.apache.http.impl.client.HttpClientBuilder;

/**
 * Base for all Http request builders.
 */
public interface IRequestBuilderBase> {

    /**
     * Adds a value to the specified header. Existing values will
     * be kept.
     */
    public T addHeaderValue(String key, String value);

    /**
     * Adds some values to the specified header. Existing values will
     * be kept.
     */
    public T addHeaderValues(String key, List values);

    /**
     * Sets the headers. Existing headers will be overwritten.
     */
    public T setHeaders(Map> headers);

    /**
     * Sets the values of the specified header. Existing values 
     * of this header will be overwritten.
     */
    public T setHeaderValues(String key, List values);

    /**
     * Adds a cookie.
     */
    public T addCookie(String name, String value);

    /**
     * Adds a cookie.
     */
    public T addCookie(ICookie cookie);

    /**
     * Adds some cookies.
     */
    public T addCookies(Collection cookies);

    /**
     * Sets a custom RequestConfig to use. If not provided,
     * a default one will be used.
     */
    public T setRequestConfig(RequestConfig requestConfig);

    /**
     * Sets a specific HttpClientBuilder to use. If not provided,
     * a default one will be used.
     */
    public T setHttpClientBuilder(HttpClientBuilder httpClientBuilder);

    /**
     * Disables SSL certificates errors (such as self-signed 
     * certificate errors).
     * 
     * SSL certificate errors are not disabled by default.
     * 
     * Be sure you know what you are doing if you disable this! It may lead to
     * some security concerns.
     */
    public T disableSslCertificateErrors();

    /**
     * Set HTTP authentication credentials.
     */
    public T setHttpAuthCredentials(String username, String password);

    /**
     * Sends the request and gets the response.
     */
    public IHttpResponse send();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy