0
Good morning friends. How can I spend one body in the request GET?
I have an API that does a CPF search in a PDF and returns the page it is on. In the terminal, the command is as follows:
http GET http://127.0.0.1:8000/files/processed/cpf.pdf data="123.456.789-10"
I would like to consume this API with Dart/Flutter, but I cannot pass the body in the request. I tried with the following code:
class PdfSearch{
Future catchPage(String numero) async {
Uri uri = Uri.parse("http://127.0.0.1:8000/files/processed/cpf.pdf");
http.Request request = http.Request("GET", uri);
request.body = '{"data": $numero}';
final response = request.send().asStream().first;
}
}
Unsuccessful...