Unable to make calls to Localhost using Flutter, random port being assigned to HTTP GET call
- 阅读更多 关于 Unable to make calls to Localhost using Flutter, random port being assigned to HTTP GET call
问题 I'm attempting to build a Flutter app where I'm required to make an HTTP call using the dart http library. So here's a snipped of the fu I use to make the call, import 'package:flutter/material.dart'; import 'dart:async'; import 'dart:convert'; import 'dart:io'; import 'package:http/http.dart' as http; Future<List> getData() async { List data = new List(); var httpClient = new HttpClient(); var request = await httpClient.get("localhost", 5000, '/search?query=hello'); var response = await