本文整理汇总了Java中org.glassfish.jersey.client.JerseyClient.target方法的典型用法代码示例。如果您正苦于以下问题:Java JerseyClient.target方法的具体用法?Java JerseyClient.target怎么用?Java JerseyClient.target使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.glassfish.jersey.client.JerseyClient
的用法示例。
在下文中一共展示了JerseyClient.target方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import org.glassfish.jersey.client.JerseyClient; //导入方法依赖的package包/类
public <RootResponse> Response<RootResponse> create(@NonNull String url, @NonNull Class<RootResponse> clazz,
ClientConfiguration clientConfigurationOrNull) {
Optional<ClientConfiguration> clientConfiguration = Optional.ofNullable(clientConfigurationOrNull);
JerseyClient newClient = jerseyClientBuilder.register(SseFeature.class).withConfig(clientConfig).build();
newClient.register(LastEventIdHeaderFilter.class);
if (clientConfigurationOrNull != null && !Strings.isNullOrEmpty(clientConfigurationOrNull.getAuthorization())) {
newClient.register(new AuthHeaderFilter(clientConfigurationOrNull.getAuthorization()));
}
MediaType mediaType = clientConfiguration.map(c -> c.getMediaType()).orElse(MediaType.APPLICATION_JSON_TYPE);
ResponseBuilder responseBuilder = new ResponseBuilder(newClient, objectMapper, mediaType);
JerseyWebTarget webTarget = newClient.target(url);
Builder requestBuilder = webTarget.request(mediaType);
String readEntity = requestBuilder.get().readEntity(String.class);
return responseBuilder.buildResponse(readEntity, clazz, URI.create(url)).get();
}
示例2: setUp
import org.glassfish.jersey.client.JerseyClient; //导入方法依赖的package包/类
@Before
public void setUp() {
baseUrl = format("http://localhost:%d", port);
final JerseyClient client = JerseyClientBuilder.createClient();
client.property(ClientProperties.FOLLOW_REDIRECTS, false);
target = client.target(baseUrl + "/stormpath");
}
开发者ID:shiver-me-timbers,项目名称:smt-spring-security-parent,代码行数:8,代码来源:ITSpringSecurityStormpathApplicationHref.java
示例3: setUp
import org.glassfish.jersey.client.JerseyClient; //导入方法依赖的package包/类
@Before
public void setUp() {
baseUrl = format("http://localhost:%d", port);
final JerseyClient client = JerseyClientBuilder.createClient();
client.property(ClientProperties.FOLLOW_REDIRECTS, false);
target = client.target(baseUrl + "/all");
}
示例4: setUp
import org.glassfish.jersey.client.JerseyClient; //导入方法依赖的package包/类
@Before
public void setUp() {
final JerseyClient client = JerseyClientBuilder.createClient();
client.property(ClientProperties.FOLLOW_REDIRECTS, false);
annotationTarget = client.target(format("http://localhost:%d/jwt", port));
normalTarget = client.target(format("http://localhost:%d/normal", port));
}
开发者ID:shiver-me-timbers,项目名称:smt-spring-security-parent,代码行数:8,代码来源:AbstractSpringSecurityJwtAnnotation.java
示例5: setUp
import org.glassfish.jersey.client.JerseyClient; //导入方法依赖的package包/类
@Before
public void setUp() {
final JerseyClient client = JerseyClientBuilder.createClient();
client.property(ClientProperties.FOLLOW_REDIRECTS, false);
annotationTarget = client.target(format("http://localhost:%d/custom", port));
}