public class HttpClients
extends java.lang.Object
HttpStreams
. They are
passed into methods such as
HttpStreams.requests(org.apache.edgent.topology.TStream, Supplier, org.apache.edgent.function.Function, org.apache.edgent.function.Function, org.apache.edgent.function.BiFunction)
as functions, for example:
() -> HttpClients::noAuthentication
// using a method reference() -> HttpClients.basic("user", "password")
// using a lambda expressionHttpStreams
Constructor and Description |
---|
HttpClients() |
Modifier and Type | Method and Description |
---|---|
static org.apache.http.impl.client.CloseableHttpClient |
basic(java.lang.String user,
java.lang.String password)
Create a basic authentication HTTP client with a fixed user and password.
|
static org.apache.http.impl.client.CloseableHttpClient |
basic(Supplier<java.lang.String> user,
Supplier<java.lang.String> password)
Method to create a basic authentication HTTP client.
|
static org.apache.http.impl.client.CloseableHttpClient |
noAuthentication()
Create HTTP client with no authentication.
|
public static org.apache.http.impl.client.CloseableHttpClient noAuthentication()
HttpStreams
public static org.apache.http.impl.client.CloseableHttpClient basic(java.lang.String user, java.lang.String password)
user
- User for authenticationpassword
- Password for authenticationHttpStreams
public static org.apache.http.impl.client.CloseableHttpClient basic(Supplier<java.lang.String> user, Supplier<java.lang.String> password)
user
and password
are called
when this method is invoked to obtain the user and password
and runtime.user
- Function that provides user for authenticationpassword
- Function that provides password for authenticationHttpStreams
Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641