Ejemplo n.º 1
0
        public static async Task <CleverbotAskResponse> GetResponseAsync(CleverbotAskRequest request)
        {
            var json   = JsonConvert.SerializeObject(request);
            var result = await CleverbotUserAgent.PostAsync(CleverbotAskApiUrl, json);

            return(JsonConvert.DeserializeObject <CleverbotAskResponse>(result));
        }
Ejemplo n.º 2
0
        public static async Task <CleverbotCreateResponse> GetResponseAsync(CleverbotCreateRequest request)
        {
            var json = JsonConvert.SerializeObject(request, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            });
            var result = await CleverbotUserAgent.PostAsync(CleverbotCreateApiUrl, json);

            return(JsonConvert.DeserializeObject <CleverbotCreateResponse>(result));
        }