Is there a function to do urlencoding in Dart? I am doing a AJAX call using XMLHttpRequest object and I need the url to be url encoded.
I did a search on dartlang.org, but it didn’t turn up any results.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Update: There is now support for encode/decode URI in the Dart Uri class
Dart’s URI code is placed in a separate library called dart:uri (so it can be shared between both
dart:htmlanddart:io). It looks like it currently does not include aurlencodefunction so your best alternative, for now, is probably to use this Dart implementation of JavaScript’sencodeUriComponent.