本文整理匯總了Java中com.jcabi.http.wire.AutoRedirectingWire類的典型用法代碼示例。如果您正苦於以下問題:Java AutoRedirectingWire類的具體用法?Java AutoRedirectingWire怎麽用?Java AutoRedirectingWire使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AutoRedirectingWire類屬於com.jcabi.http.wire包,在下文中一共展示了AutoRedirectingWire類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: AuthByPass
import com.jcabi.http.wire.AutoRedirectingWire; //導入依賴的package包/類
/**
* Public ctor, with a custom req.
*
* @param uri Hub URI
* @param req Request to start from
*/
public AuthByPass(
final URI uri,
final Request req) {
this.uri = uri;
this.req = req.header(HttpHeaders.USER_AGENT, AuthByPass.USER_AGENT)
.through(AutoRedirectingWire.class)
.uri()
.path("/hub/api/rest/oauth2/token")
.back()
.method(Request.POST)
.header(
HttpHeaders.CONTENT_TYPE,
"application/x-www-form-urlencoded"
);
}
示例2: RtHub
import com.jcabi.http.wire.AutoRedirectingWire; //導入依賴的package包/類
/**
* Public ctor, with a custom req.
*
* @param req Request to start from
*/
public RtHub(
final Request req) {
this.req = req.header(HttpHeaders.USER_AGENT, RtHub.USER_AGENT)
.through(AutoRedirectingWire.class)
.uri()
.path("/hub/api/rest")
.back();
}