本文介绍了您如何在Erlang中对参数进行URL编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 httpc:request 将一些数据发布到远程服务。我的帖子正常运行,但是帖子的body()中的数据按原样通过,没有任何URL编码,这导致该帖子在通过远程服务进行解析时失败。
I'm using httpc: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.
Erlang中是否有一个类似于 CGI的函数。
Is there a function in Erlang that is similar to CGI.escape in Ruby for this purpose?
推荐答案您可以在此处找到 YAWS url_encode和url_decode例程
它们很简单,尽管注释表明所有标点字符的编码都不是100%完整。
They are fairly straightforward, although comments indicate the encode is not 100% complete for all punctuation characters.
更多推荐
您如何在Erlang中对参数进行URL编码?
发布评论