URL编码在Erlang [英] URL encode in 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屋!