URL编码在Erlang [英] URL encode in Erlang

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

问题描述

我使用erlang http:请求将一些数据发布到远程服务。我的帖子工作,但该文章的body()中的数据是按原样进行的,没有任何url编码,导致该文档在远程服务解析时失败。


解决方案

可以找到Erlang中的一个函数与Ruby中的CGI.escape类似这里是 YAWS urlencode和urldecode例程



它们相当简单,虽然注释表示编码对于所有标点符号字符不完全100%。


I'm using erlang http:request to post some data to a remote service. I have the post working but the data in the body() of the post comes through as is, without any url encoding which causes the post to fail when parsed by the remote service.

Is there a function in Erlang that is similar to CGI.escape in Ruby for this purpose?

解决方案

You can find here the YAWS urlencode and urldecode routines

They are fairly straightforward, although comments indicate the encode is not 100% complete for all punctuation characters.

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

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