Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AlexanderBollbach/2c80d53b5ad1c0ea920757bf1e6d49a5 to your computer and use it in GitHub Desktop.
Save AlexanderBollbach/2c80d53b5ad1c0ea920757bf1e6d49a5 to your computer and use it in GitHub Desktop.
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