Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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));
        }