public void RestRequestAsync <TResponse>(Request <TResponse> request, RestliCallback <TResponse> restliCallback) where TResponse : Response { HttpRequest httpRequest = ClientUtil.BuildHttpRequest(request, urlPrefix); TransportCallback transportCallback = new RestliCallbackAdapter <TResponse>(request.responseDecoder, restliCallback); transportClient.RestRequestAsync(httpRequest, transportCallback); }
public TResponse RestRequestSync <TResponse>(Request <TResponse> request) where TResponse : Response { HttpRequest httpRequest = ClientUtil.BuildHttpRequest(request, urlPrefix); HttpResponse httpResponse = transportClient.RestRequestSync(httpRequest); TransportResponse transportResponse = new TransportResponse(httpResponse); if (transportResponse.hasError()) { throw transportResponse.getError().error; } return(request.responseDecoder.DecodeResponse(transportResponse)); }