您如何在Erlang中对参数进行URL编码?

编程入门 行业动态 更新时间:2024-10-24 22:20:21
本文介绍了您如何在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编码?

本文发布于:2023-11-26 21:15:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1635217.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中对   参数   如何在   URL   Erlang

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!