How do you URL encode parameters in Erlang?

前端 未结 8 1112
清歌不尽
清歌不尽 2020-12-31 01:17

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

相关标签:
8条回答
  • 2020-12-31 01:54

    You can find here the YAWS url_encode and url_decode routines

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

    0 讨论(0)
  • 2020-12-31 02:04

    At least in R15 there is http_uri:encode/1 which does the job. I would also not recommend using edoc_lib:escape_uri as its translating an '=' to a %3d instead of a %3D which caused me some trouble.

    0 讨论(0)
提交回复
热议问题