- java.lang.Object
-
- io.avaje.http.client.BasicAuthIntercept
-
- All Implemented Interfaces:
RequestIntercept
public class BasicAuthIntercept extends Object implements RequestIntercept
Adds Basic Authorization header to requests.
-
-
Constructor Summary
Constructors Constructor Description BasicAuthIntercept(String username, String password)Construct with the username and password.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeforeRequest(HttpClientRequest request)Before the request has been made.static Stringencode(String username, String password)Return Base64 encoding of username:password-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.avaje.http.client.RequestIntercept
afterResponse
-
-
-
-
Method Detail
-
encode
public static String encode(String username, String password)
Return Base64 encoding of username:password
-
beforeRequest
public void beforeRequest(HttpClientRequest request)
Description copied from interface:RequestInterceptBefore the request has been made.Typically we can add headers or modify the request prior to it being sent.
- Specified by:
beforeRequestin interfaceRequestIntercept
-
-