Hi,
I'm trying to use the Spell API but I'm unable to do the http request.
This is my code:
using (var httpClient = new HttpClient(httpClientHandler))
{
httpClient.BaseAddress = new Uri("https://api.cognitive.microsoft.com");
httpClient.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", _bingSpellCheckApiKey);
using (var content = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("Text", text)
}))
{
using (var result = await httpClient.PostAsync("/bing/v5.0/spellcheck/", content))
{
string resultContent = await result.Content.ReadAsStringAsync();
return resultContent;
}
}
}
But I always get this answer:
"{\"_type\": \"SpellCheck\", \"flaggedTokens\": []}"
I don't understand what is different from the test page at https://dev.cognitive.microsoft.com/docs/services/56e73033cf5ff80c2008c679/operations/56e73036cf5ff81048ee6727/console
Thank you, Damiano