use of com.weibo.api.motan.protocol.restful.support.RestfulClientResponse in project motan by weibocom.
the class ClientFilter method filter.
@Override
public Response filter(Caller<?> caller, Request request) {
// pass attachment
request.setAttachment("testName", "testName");
Response response = caller.call(request);
assert response instanceof RestfulClientResponse;
RestfulClientResponse rfr = (RestfulClientResponse) response;
// obtain httpResponse 、 responseStatus、responseHeader and so on
rfr.getHttpResponse();
return response;
}
use of com.weibo.api.motan.protocol.restful.support.RestfulClientResponse in project motan by weibocom.
the class RestfulClientInvoker method invoke.
public Object invoke(Object[] args, Request req, RestfulClientResponse resp) {
ClientInvocation request = createRequest(args, req);
ClientResponse response = (ClientResponse) request.invoke();
resp.setAttachments(RestfulUtil.decodeAttachments(response.getStringHeaders()));
resp.setHttpResponse(response);
ClientContext context = new ClientContext(request, response, entityExtractorFactory);
return extractor.extractEntity(context);
}
Aggregations