【问题标题】:How to get and display the entire html url on screen through httpc: request in erlang?如何通过httpc获取并在屏幕上显示整个html url:erlang中的请求?
【发布时间】:2026-02-22 08:35:01
【问题描述】:

process (Url) ->
  {Status, Header, Body} = httpc:request(get, {Url, []}, [], []),
 io:format(Body).

没有输出 html 到 Body 来显示

如何通过 httpc:request in erlang 获取并在屏幕上显示整个 html url?

【问题讨论】:

    标签: erlang


    【解决方案1】:

    io:format/2 有点像 C 的 printf:你需要一个格式字符串。

    io:format("Body: ~p\n", [Body]).
    

    Documentation

    【讨论】:

    • 进程 出错,退出值:{{badmatch,{error,no_scheme}},[{test,process,1,[{file,"test.erl"}, {line,30}]}]}
    最近更新 更多