use of jakarta.ws.rs.client.Entity in project jaxrs-api by eclipse-ee4j.
the class JaxrsWebTestCase method buildRequest.
/**
* Build Invocation
*/
protected Invocation buildRequest(WebTarget target) {
Invocation.Builder builder;
builder = target.request(getAcceptMediaType());
for (Entry<String, String> entry : headerMap.entrySet()) {
if (!entry.getKey().equals("Accept"))
builder.header(entry.getKey(), entry.getValue());
}
Invocation i;
if (entity != null) {
if (entity instanceof Entity)
i = builder.build(requestType, (Entity<?>) entity);
else
i = builder.build(requestType, Entity.entity(entity, getContentType()));
TestUtil.logMsg("[Request] Adding entity: " + entity);
} else
i = builder.build(requestType);
return i;
}
Aggregations