mrblib/mrb_simplehttpserver.rb
# Convert the response returned by @app.call into a HTTP response.
# https://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html
#
# @param [ Fixnum ]               code   The HTTP status code.
# @param [ Hash<String, String> ] header The header as a key-value list.
# @param [ String ]               body   The message body.
#
# @return [ String ]
Convert the response returned by @app.call into a HTTP response.
Convert the response returned by @app . call into a HTTP response .
def create_response(code, header, body)
    header[:Date] ||= http_date
    header[:Connection] = :close
    header_ary = []
    header.each { |k, v| header_ary << ["#{k}:#{v}"] if v }
    http_status_line(code) + SEP \
    + header_ary.join(SEP) + SEP + SEP \
    + body
  end
def create_response ( code , header , body ) header [ :Date ] ||= http_date header [ :Connection ] = :close header_ary = [ ] header . each { | k , v | header_ary << [ "#{k}:#{v}" ] if v } http_status_line ( code ) + SEP + header_ary . join ( SEP ) + SEP + SEP + body end
Convert the response returned by @app.call into a HTTP response.
Convert the response returned by @app . call into a HTTP response .
None
 String 
code
header
body
body The message body.
body The message body .