Does HttpClient support SUGGEST?

Hi,

I had suggest working with C# MySQL.Data libraries using format:

Call SUGGEST ('somevalue', 'my_index');

However, after migrating to HttpClient libraries, it no longer is working. Any guidance or referral to some documentation would be greatly appreciated.

Pls provide more details on what library you are using and the error.

Error message is: “only SELECT queries are supported”

C# library: System.Net.Http

Sample Code:

      var suggest = $"CALL SUGGEST('apprl','my_index')";

       System.Net.Http HttpClient _httpClient = new HttpClient();
         var encodedQuery = new StringContent("query=" + suggest, 
             Encoding.UTF8, "application/x-www-form-urlencoded");

         try

         {

                System.Net.Http.HttpResponseMessage response = 
               _httpClient.PostAsync("https://srv10v/sql", encodedQuery).Result;
 
                string responsBody = response.Content.ReadAsStringAsync().Result;
                                                                              
                var jsonResults = JsonConvert.DeserializeObject<SuggestResponse>(responsBody);
           }
          catch
         {

          }

Pls use the “raw” mode Manticore Search Manual: Connecting to the server > HTTP

1 Like

Perfect, thank you so much, that resolved my problem