Why is rack response body an array not a string?

后端 未结 2 1471
野性不改
野性不改 2021-02-12 14:11

a classic hello world example from their doc,

class HelloWorld
  def call(env)
    return [200, {}, [\"Hello world!\"]]
  end
end

my question

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-12 14:45

    I think rack originated on python's wsgi. Here is the explanation for python: http://www.python.org/dev/peps/pep-3333/#buffering-and-streaming

提交回复
热议问题