在Dart中的urlencoding [英] urlencoding in Dart

查看:712
本文介绍了在Dart中的urlencoding的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个函数做Dart中的urlencoding吗?我使用XMLHttpRequest对象做一个AJAX调用,我需要url编码。

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.

我在dartlang.org上搜索,但是没有打开任何结果。

I did a search on dartlang.org, but it didn't turn up any results.

推荐答案

更新:现在支持 Dart Uri类

Dart的URI代码放在一个名为 dart:uri (因此可以在 dart:html dart:io )。我看起来它目前不包括 urlencode 函数,所以你现在最好的选择可能是使用 this Dart实现JavaScript的 encodeUriComponent

Dart's URI code is placed in a separate library called dart:uri (so it can be shared between dart:html and dart:io). I looks like it currently does not include a urlencode function so your best alternative for now is probably to use this Dart implementation of JavaScript's encodeUriComponent.

这篇关于在Dart中的urlencoding的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆