going on Flutter documentation I found that fetching data was done, sometimes, by using
http.Client and sometimes not (just
http.get for example). So I was wondering the purpose of using
These are the two sites where I found this:
Solution 1: Richard Heap
http package uses a default
IOClient when you use the convenience
http.post methods. However, sometimes you might want to use a specialized
Client, for example to change the default HTTPS certificate validation. See this question.
In this circumstance, you can create any
Client subclass and use it in the ways shown in your second link. It's rarely necessary, though so the syntax used in your first link is normally sufficient.