如果它取回JSON的根目录,那么Elm zip代码示例会是什么样子?

时间:2015-12-17 03:15:36

标签: elm

您好我正在努力使用Elm获取JSON的根目录。 所有示例都显示解码嵌套的[{info here}]。

如果获得JSON的根目录,那么在Elm网站上找到的邮政编码示例会是什么样子? {“邮政编码”:“我想要这个”}。

http的步骤是什么?>解码Json(一个字符串“post code”) - >主要输出。

由于

2 个答案:

答案 0 :(得分:2)

您可能已经拥有它但需要

http.get ("post code" := string) url
    |> Task.maybe
    |> Task.map ActionName
    |> Effects.task

我最近构建了一个用于测试Decode函数的Json.Decode解释器 - 请参阅http://simonh1000.github.io/decoder

答案 1 :(得分:0)

找到这个需要一段时间。 但它看起来像Japanese explanation of getting one element and turning into html

相关问题