@Immutable public final class BasicAuthWire extends Object implements Wire
This wire converts user info from URI into
"Authorization"
HTTP header, for example:
String html = new JdkRequest("http://jeff:[email protected]") .through(BasicAuthWire.class) .fetch() .body();
In this example, an additional HTTP header Authorization
will be added with a value Basic amVmZjoxMjM0NQ==
.
The class is immutable and thread-safe.
Constructor and Description |
---|
BasicAuthWire(Wire wire)
Public ctor.
|
public BasicAuthWire(@NotNull(message="wire can\'t be NULL") Wire wire)
wire
- Original wirepublic Response send(Request req, String home, String method, Collection<Map.Entry<String,String>> headers, byte[] content) throws IOException
send
in interface Wire
req
- Requesthome
- URI to fetchmethod
- HTTP methodheaders
- Headerscontent
- HTTP bodyIOException
- if failsCopyright © 2012–2014 jcabi.com. All rights reserved.