* Get high level information about request as string * @param {Object} options * @param {string} options.method * @param {number|string} options.port * @param {string} options.proto Set internally. always http or https * @param {string} options.hostname * @param {string} options.path *
(options, body)
| 78 | * @return {string} |
| 79 | */ |
| 80 | function stringifyRequest(options, body) { |
| 81 | const { method = 'GET', path = '', port } = options |
| 82 | const origin = normalizeOrigin(options.proto, options.hostname, port) |
| 83 | |
| 84 | const log = { |
| 85 | method, |
| 86 | url: `${origin}${path}`, |
| 87 | headers: options.headers, |
| 88 | } |
| 89 | |
| 90 | if (body) { |
| 91 | log.body = body |
| 92 | } |
| 93 | |
| 94 | return JSON.stringify(log, null, 2) |
| 95 | } |
| 96 | |
| 97 | function isContentEncoded(headers) { |
| 98 | const contentEncoding = headers['content-encoding'] |
nothing calls this directly
no test coverage detected