src/Classificationbox.Net/ServiceWrapper.cs
/// <summary>
/// Lists all the existing models.
/// </summary>
/// <returns></returns>
Lists all the existing models.
Lists all the existing models .
public ListModelsResponse ListModels()
        {
            using (HttpClient client = new HttpClient())
            {
                var request = new HttpRequestMessage
                {
                    Method = HttpMethod.Get,
                    RequestUri = new Uri(string.Format("{0}/classificationbox/models", _baseUrl))
                };
                HttpResponseMessage rsp;
                try
                {
                    rsp = client.SendAsync(request).GetAwaiter().GetResult();
                }
                catch (Exception ex)
                {
                    var s = ex.InnerException?.InnerException?.Message ?? ex.InnerException?.Message ?? ex.Message;
                    Debug.WriteLine(s);
                    return new ListModelsResponse() { error = ex.Message };
                }
                var rspStr = rsp.Content.ReadAsStringAsync().Result;
                var obj = JsonConvert.DeserializeObject<ListModelsResponse>(rspStr);
                return obj;
            }
        }
public ListModelsResponse ListModels ( ) { using ( HttpClient client = new HttpClient ( ) ) { var request = new HttpRequestMessage { Method = HttpMethod . Get , RequestUri = new Uri ( string . Format ( " " , _baseUrl ) ) } ; HttpResponseMessage rsp ; try { rsp = client . SendAsync ( request ) . GetAwaiter ( ) . GetResult ( ) ; } catch ( Exception ex ) { var s = ex . InnerException ? . InnerException ? . Message ?? ex . InnerException ? . Message ?? ex . Message ; Debug . WriteLine ( s ) ; return new ListModelsResponse ( ) { error = ex . Message } ; } var rspStr = rsp . Content . ReadAsStringAsync ( ) . Result ; var obj = JsonConvert . DeserializeObject < ListModelsResponse > ( rspStr ) ; return obj ; } }
Lists all the existing models.
Lists all the existing models .
None