name=doodle&color=blue&homeTeam=%7B%22team%22%3A%22Team+A%22%7D&awayTeam=%7B%22team%22%3A%22Team+B%22%7D或者,这个 Map<String, String> body = { 'name': 'doodle', 'color': 'blue', 'teamJson': json.encode({ 'homeTeam': {'team': 'Team A'}, 'awayTeam': {'team': 'Team B'}, }), }; Response r = await post( url, body: body, );在电线上产生这个name=doodle&color=blue&teamJson=%7B%22homeTeam%22%3A%7B%22team%22%3A%22Team+A%22%7D%2C%22awayTeam%22%3A%7B%22team%22%3A%22团队+B%22%7D%7Dname=doodle&color=blue&teamJson=%7B%22homeTeam%22%3A%7B%22team%22%3A%22Team+A%22%7D%2C%22awayTeam%22%3A%7B%22team%22%3A%22Team+B%22%7D%7Dpackage:http 客户端负责:对 Uri.encodeQueryComponent 进行编码,utf8 编码(注意这是默认的,所以不需要指定它)并在 Content-Length 中发送长度标题.您仍然必须进行json编码.the package:http client takes care of: encoding the Uri.encodeQueryComponent, utf8 encoding (note that that's the default, so no need to specify it) and sending the length in the Content-Length header. You must still do the json encoding. 这篇关于如何在flutter中使用url编码的正文发出HTTP POST请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!