Package com.jcabi.http.wire
Class VerboseWire
- java.lang.Object
-
- com.jcabi.http.wire.VerboseWire
-
- All Implemented Interfaces:
Wire
@Immutable public final class VerboseWire extends Object implements Wire
Verbose wire.This wire makes HTTP request and response details visible in log (we're using SLF4J logging facility), for example:
String html = new JdkRequest("http://goggle.com") .through(VerboseWire.class) .header(HttpHeaders.ACCEPT, MediaType.TEXT_PLAIN) .fetch() .body();The class is immutable and thread-safe.
- Since:
- 0.10
-
-
Constructor Summary
Constructors Constructor Description VerboseWire(Wire wire)Public ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Responsesend(Request req, String home, String method, Collection<Map.Entry<String,String>> headers, InputStream content, int connect, int read)Send request and return response.
-
-
-
Constructor Detail
-
VerboseWire
public VerboseWire(Wire wire)
Public ctor.- Parameters:
wire- Original wire
-
-
Method Detail
-
send
public Response send(Request req, String home, String method, Collection<Map.Entry<String,String>> headers, InputStream content, int connect, int read) throws IOException
Description copied from interface:WireSend request and return response.- Specified by:
sendin interfaceWire- Parameters:
req- Requesthome- URI to fetchmethod- HTTP methodheaders- Headerscontent- HTTP bodyconnect- The connect timeoutread- The read timeout- Returns:
- Response obtained
- Throws:
IOException- if fails
-
-