webmachine的init 和 to_html
请问 群里 有没有 用 webmachine, init 和 to_html 是必须的吗?
这个问题 困惑了 我一会。昨天就应该发现他们的本质,还好只拖到了今天开始
下面 默认提供的to_html方法,当然如果喜欢 可以改成to_htm
init是必须的 初始化用的
。。。。。
?
Handler?is an atom naming the function which can provide a resource representation in that media type. Content negotiation is driven by this return value. For example, if a client request includes an Accept header with a value that does not appear as a first element in any of the return tuples, then a 406 Not Acceptable will be sent.