Error calling service "auto-complete" [closed]

0

I'm finalizing a system and now the need to present a user field with autocomplete to the user.

Then I had the idea of using autocomplete of the dictionary michaelis .

If you access the SITE will see what you have in the field of typing search will show word suggestions.

I was able to find the following service link

But I can not pass the parameters, can you help me with this problem?

Edit:

What I want to do is the site link

That returns a json with word suggestions, play this link in postman to see the return.

    
asked by anonymous 28.08.2017 / 18:13

1 answer

2

I was able to call the above service as follows:

I simulated through the browser and checked which parameters were passed to the service. The successful simulation below follows. In addition to the word parameter, you must also pass three other parameters: r, f and t there is also a fifth parameter _csrf but the call worked even without it. Also note that the parameter type is x-www-form-urlencoded I also put below a C # code for the call.

varclient=newRestClient("http://michaelis.uol.com.br/suggest/");
var request = new RestRequest(Method.POST);
request.AddHeader("postman-token", "3e206738-01a8-46b6-0952-bc776e3d1608");
request.AddHeader("cache-control", "no-cache");
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "r=0&f=0&t=0&palavra=coletor", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
    
28.08.2017 / 18:43