You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below sample code is auto replacing '+' character in a query parameter with space, when fetching value using queryParameters.
Uri uri = Uri.parse('https://test.com/parse?code=sf+sf+/fd3' );
print(uri.query); //print - code=sf+sf+/fd3
print(uri.queryParameters['code']); //prints - sf sf /fd3
How to solve this?
The text was updated successfully, but these errors were encountered:
Thanks, I know that replacing '+' with '%2B' will result into the correct string. But is it the official way to solve this?
And is conversion from plus to space expected? What other characters need to be replaced?
The conversion from + to space is expected. See #43838.
Dart's Uri class expects query parameters to be form-encoded. That seemed like a great idea at the time, but JavaScript moved in a different direction with their Url class, so now Dart is just different.
The URI parser also escapes some other characters, which are not valid in RFC-3986 URIs. Whether you expect that or not is up to you.
Below sample code is auto replacing '+' character in a query parameter with space, when fetching value using queryParameters.
How to solve this?
The text was updated successfully, but these errors were encountered: