Esempio n. 1
0
 internal Task <T> AccessJsonParameteredApiAsyncImpl <T>(string url, IEnumerable <KeyValuePair <string, object> > parameters, string[] jsonMap, CancellationToken cancellationToken, string jsonPath)
 {
     return(this.SendJsonRequestAsync(InternalUtils.GetUrl(this.ConnectionOptions, url), parameters, jsonMap, cancellationToken)
            .ReadResponse(s => CoreBase.Convert <T>(s, jsonPath), cancellationToken));
 }
Esempio n. 2
0
 internal Task <DictionaryResponse <TKey, TValue> > AccessApiDictionaryAsyncImpl <TKey, TValue>(MethodType type, string url, IEnumerable <KeyValuePair <string, object> > parameters, CancellationToken cancellationToken, string jsonPath)
 {
     return(this.SendRequestAsyncImpl(type, InternalUtils.GetUrl(this.ConnectionOptions, url), parameters, cancellationToken)
            .ReadResponse(s => new DictionaryResponse <TKey, TValue>(CoreBase.Convert <Dictionary <TKey, TValue> >(s, jsonPath)), cancellationToken));
 }
Esempio n. 3
0
 internal T AccessApi <T>(MethodType type, string url, IDictionary <string, object> parameters, string jsonPath = "")
 {
     using (var s = this.SendRequest(type, InternalUtils.GetUrl(url), parameters))
         using (var sr = new StreamReader(s))
             return(CoreBase.Convert <T>(this, sr.ReadToEnd(), jsonPath));
 }