I'm implementing a custom module for Erlang's httpd (inets) server. I can successfully respond with HTML content with the following implementation of do method:
do(_ModData) ->
    Body = "<html><body&开发者_运维技巧gt;Hello world</body></html>",
    {proceed, [{response, {200, Body}}]}.
but the problem is I cannot find a way to respond with custom headers and text/xml content type. 
According to erlang httpd docs, I can respond with [{response,{response,Head,Body}}], where "Head is a key value list of HTTP header fields" (quote from the docs), but what should be the exact format of this list? I tried the following, but it gives 404:
do(_ModData) ->
    Body = "<html><body>Stats Placeholder</body></html>",
    Head = ["Content-Length", "40", "Content-Type", "text/html"],
    {proceed, [{response, {response, Head, Body}}]}.
Any help on this would be appreciated, the docs and examples for erlang httpd are really sparse...
Try [{content_length, "40"}, {content_type, "text/html"}]
Try [{"Content-Length", "40"}, {"Content-Type", "text/html"}]
LOL. Is in the doc.
[{code, 200}, {content_length, "40"}, {content_type, "text/html"}]
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论