def http = HttpBuilder.configure {
request.uri = 'http://localhost:10101'
request.auth.basic 'admin', '$3cr3t', true
}
public static class HttpConfigs.BasicAuth extends java.lang.Object implements HttpConfig.Auth
Constructor and Description |
---|
BasicAuth() |
Modifier and Type | Method and Description |
---|---|
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 . |
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
basic, digest
public void basic(java.lang.String user, java.lang.String password, boolean preemptive)
HttpConfig.Auth
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
}
basic
in interface HttpConfig.Auth
user
- the usernamepassword
- the user’s passwordpreemptive
- whether or not this call will override similar configuration in the chainpublic void digest(java.lang.String user, java.lang.String password, boolean preemptive)
HttpConfig.Auth
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
}
digest
in interface HttpConfig.Auth
user
- the usernamepassword
- the user’s passwordpreemptive
- whether or not this call will override similar configuration in the chainpublic java.lang.String getUser()
HttpConfig.Auth
Retrieves the configured user for the request.
getUser
in interface HttpConfig.Auth
public java.lang.String getPassword()
HttpConfig.Auth
Retrieves the configured password for the request.
getPassword
in interface HttpConfig.Auth
public HttpConfig.AuthType getAuthType()
HttpConfig.Auth
Retrieve the authentication type for the request.
getAuthType
in interface HttpConfig.Auth
HttpConfig.AuthType
for the Request