* Converts a headers map to a HTTP header block string. * @param {!Map } headers The map to convert. * @return {string} The headers as a string.
(headers)
| 71 | * @return {string} The headers as a string. |
| 72 | */ |
| 73 | function headersToString(headers) { |
| 74 | const ret = [] |
| 75 | headers.forEach(function (value, name) { |
| 76 | ret.push(`${name.toLowerCase()}: ${value}`) |
| 77 | }) |
| 78 | return ret.join('\n') |
| 79 | } |
| 80 | |
| 81 | /** |
| 82 | * Represents a HTTP request message. This class is a "partial" request and only |