Package com.jcabi.http
Interface Wire
-
- All Known Implementing Classes:
AbstractHeaderBasedCachingWire,AutoRedirectingWire,BasicAuthWire,CachingWire,CookieOptimizingWire,ETagCachingWire,FcWire,LastModifiedCachingWire,OneMinuteWire,RetryWire,TrustedWire,UserAgentWire,VerboseWire
@Immutable public interface WireWire.An instance of this interface can be used in
Request.through(Class,Object...)to decorate an existingwire, for example:String html = new JdkRequest("http://google.com") .through(VerboseWire.class) .through(RetryWire.class) .header("Accept", "text/html") .fetch() .body();Every
Wiredecorator passed tothrough()method wraps a previously existing one.- Since:
- 0.9
-
-
Method Summary
All Methods Instance Methods Abstract 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.
-
-
-
Method Detail
-
send
Response send(Request req, String home, String method, Collection<Map.Entry<String,String>> headers, InputStream content, int connect, int read) throws IOException
Send request and return response.- Parameters:
req- Requesthome- URI to fetchmethod- HTTP methodheaders- Headerscontent- HTTP bodyconnect- The connect timeoutread- The read timeout- Returns:
- Response obtained
- Throws:
IOException- if fails
-
-