gpt4 book ai didi

query-string - 如何解析 Dart 中的查询字符串?

转载 作者:行者123 更新时间:2023-12-03 02:41:29 24 4
gpt4 key购买 nike

如何在 Dart 中安全地解析查询字符串?

假设我有 q具有以下值的字符串:

?page=main&action=front&sid=h985jg9034gj498g859gh495

理想情况下,代码应该在服务器和客户端都工作,但现在我将满足于工作客户端代码。

最佳答案

越简单越好。寻找 splitQueryString Uri 类的静态方法。

Map<String, String> splitQueryString(String query, {Encoding encoding: UTF8}) 

Returns the query split into a map according to the rules specified for
FORM post in the HTML 4.01 specification section 17.13.4. Each key and value
in the returned map has been decoded. If the query is the empty string an
empty map is returned.

关于query-string - 如何解析 Dart 中的查询字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13108689/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com