Search in sources :

Example 1 with ClientResponse

use of org.jboss.resteasy.client.ClientResponse in project quickstarts by jboss-switchyard.

the class MyClientExecutionInterceptor method execute.

public ClientResponse execute(ClientExecutionContext ctx) throws Exception {
    ClientRequest request = ctx.getRequest();
    ClientResponse response = null;
    response = ctx.proceed();
    if ((response.getResponseStatus() != null) && (response.getResponseStatus().getStatusCode() == 404)) {
        BaseClientResponse r = (BaseClientResponse) response;
        MultivaluedMap<String, String> headers = r.getHeaders();
        headers.add("full-path", request.getUri());
        r.setHeaders(headers);
    }
    return response;
}
Also used : BaseClientResponse(org.jboss.resteasy.client.core.BaseClientResponse) ClientResponse(org.jboss.resteasy.client.ClientResponse) BaseClientResponse(org.jboss.resteasy.client.core.BaseClientResponse) ClientRequest(org.jboss.resteasy.client.ClientRequest)

Aggregations

ClientRequest (org.jboss.resteasy.client.ClientRequest)1 ClientResponse (org.jboss.resteasy.client.ClientResponse)1 BaseClientResponse (org.jboss.resteasy.client.core.BaseClientResponse)1