def http = HttpBuilder.configure {
request.uri = 'http://localhost:10101'
request.auth.basic 'admin', '$3cr3t'
}
public static interface HttpConfig.Auth
Defines the configurable HTTP request authentication properties.
Modifier and Type | Method and Description |
---|---|
default void |
basic(java.lang.String user,
java.lang.String password)
Configures the request to use BASIC authentication with the given
username and password . |
void |
basic(java.lang.String user,
java.lang.String password,
boolean preemptive)
Configures the request to use BASIC authentication with the given
username and password . |
default void |
digest(java.lang.String user,
java.lang.String password)
Configures the request to use DIGEST authentication with the given username and password.
|
void |
digest(java.lang.String user,
java.lang.String password,
boolean preemptive)
Configures the request to use DIGEST authentication with the given information.
|
HttpConfig.AuthType |
getAuthType()
Retrieve the authentication type for the request.
|
java.lang.String |
getPassword()
Retrieves the configured password for the request.
|
java.lang.String |
getUser()
Retrieves the configured user for the request.
|
HttpConfig.AuthType getAuthType()
Retrieve the authentication type for the request.
HttpConfig.AuthType
for the Requestjava.lang.String getUser()
Retrieves the configured user for the request.
java.lang.String getPassword()
Retrieves the configured password for the request.
default void basic(java.lang.String user, java.lang.String password)
Configures the request to use BASIC authentication with the given username
and password
. The authentication will not be preemptive. This
method is an alias for calling: basic(String, String, false)
.
def http = HttpBuilder.configure {
request.uri = 'http://localhost:10101'
request.auth.basic 'admin', '$3cr3t'
}
user
- the usernamepassword
- the user’s passwordvoid basic(java.lang.String user, java.lang.String password, boolean preemptive)
Configures the request to use BASIC authentication with the given username
and password
.
def http = HttpBuilder.configure {
request.uri = 'http://localhost:10101'
request.auth.basic 'admin', '$3cr3t', true
}
user
- the usernamepassword
- the user’s passwordpreemptive
- whether or not this call will override similar configuration in the chaindefault void digest(java.lang.String user, java.lang.String password)
Configures the request to use DIGEST authentication with the given username and password. The authentication will not be preemptive. This
method is an alias for calling: digest(String, String, false)
.
def http = HttpBuilder.configure {
request.uri = 'http://localhost:10101'
request.auth.digest 'admin', '$3cr3t'
}
user
- the usernamepassword
- the user’s passwordvoid digest(java.lang.String user, java.lang.String password, boolean preemptive)
Configures the request to use DIGEST authentication with the given information.
def http = HttpBuilder.configure {
request.uri = 'http://localhost:10101'
request.auth.digest 'admin', '$3cr3t', true
}
user
- the usernamepassword
- the user’s passwordpreemptive
- whether or not this call will override similar configuration in the chain