URL Encoding—Ampersand Problem
It looks like the field is being encoded twice. First pass will result in & changed into %26, then urlencoding %26 will result in %2526, since the encoding for % itself is %25.
It looks like the field is being encoded twice. First pass will result in & changed into %26, then urlencoding %26 will result in %2526, since the encoding for % itself is %25.
var uri = ‘http://example.org/api?foo=some message’; var encoded = Uri.encodeFull(uri); assert(encoded == ‘http://example.org/api?foo=some%20message’); var decoded = Uri.decodeFull(encoded); assert(uri == decoded); http://www.dartlang.org/docs/dart-up-and-running/contents/ch03.html#ch03-uri
Update: There is an even better explanation (imo) further above: A URI is represented as a sequence of characters, not as a sequence of octets. That is because URI might be “transported” by means that are not through a computer network, e.g., printed on paper, read over the radio, etc. and For original character sequences … Read more
+ means a space only in application/x-www-form-urlencoded content, such as the query part of a URL: http://www.example.com/path/foo+bar/path?query+name=query+value In this URL, the parameter name is query name with a space and the value is query value with a space, but the folder name in the path is literally foo+bar, not foo bar. %20 is a valid … Read more