Пример #1
0
        /// <summary>
        /// Requests the specified request.
        /// </summary>
        /// <typeparam name="TRequest">The type of the request.</typeparam>
        /// <typeparam name="TResponse">The type of the response.</typeparam>
        /// <param name="request">The request.</param>
        /// <returns></returns>
        public TResponse Request <TRequest, TResponse>(TRequest request) where TResponse : new()
        {
            JsonWebClient jsonWebClient = new JsonWebClient();

            return(jsonWebClient.GetPOSTResponseSync <TResponse>(new Uri(CreateBaseUrl()),
                                                                 new JsonSerializer().Serialize(request)));
        }
Пример #2
0
 private TResponse Request <TRequest, TResponse>(TRequest request) where TResponse : new()
 {
     return(_jsonWebClient.GetPOSTResponseSync <TResponse>(
                new Uri(UriString),
                JsonConvert.SerializeObject(request, _jsonSerializerSettings)));
 }