Created
October 25, 2019 17:37
-
-
Save AlexanderBollbach/2c80d53b5ad1c0ea920757bf1e6d49a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private func getHttpLog(request: HTTPRequest) -> String { | |
var result: [String] = [] | |
result.append("==headers==") | |
request.headers.forEach { header in | |
result.append("key: \(header.key), value: \(header.value)") | |
} | |
result.append("==body==") | |
result.append(request.body?.string ?? "problem parsing body") | |
return result.joined(separator: "\n") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment