Exemplo n.º 1
0
        public async Task <HttpServiceResponse <TResponse> > Delete <TRequest, TResponse>(string url, TRequest request)
        {
            var client   = m_clientFactory.CreateClient("kakica");
            var response = await client.DeleteAsync($"{url}/{request.ToString()}");

            return(await HttpServiceResponse.FromMessage <TResponse>(response));
        }
Exemplo n.º 2
0
        public async Task <HttpServiceResponse <TResponse> > Get <TResponse>(string url)
        {
            var client   = m_clientFactory.CreateClient("kakica");
            var response = await client.GetAsync(url);

            return(await HttpServiceResponse.FromMessage <TResponse>(response));
        }
Exemplo n.º 3
0
        public async Task <HttpServiceResponse <TResponse> > Post <TRequest, TResponse>(string url, TRequest request)
        {
            var client   = m_clientFactory.CreateClient("kakica");
            var content  = new ObjectContent <TRequest>(request, new JsonMediaTypeFormatter());
            var response = await client.PostAsync(url, content);

            return(await HttpServiceResponse.FromMessage <TResponse>(response));
        }