Hi! Using ktor client I'd like to get all headers ...
# ktor
c
Hi! Using ktor client I'd like to get all headers of an outgoing request. I see that Ktor logs common and content headers.
Copy code
13:13:22.635 System.out         I COMMON HEADERS
13:13:22.635 System.out         I -> Accept: */*
13:13:22.635 System.out         I -> Accept-Charset: UTF-8
13:13:22.635 System.out         I CONTENT HEADERS
13:13:22.635 System.out         I -> Content-Length: 85
13:13:22.635 System.out         I -> Content-Type: application/json
but
HttpRespons::request.headers
contains only the common headers. Accept-Charset [UTF-8], and Accept [/] Is it possible to get all of the headers without using interceptors?
j
Using the Call logging plugin you can set a different log level
c
By using a plugin my flow will be different than it should, I think. I want to return the actual backend response and the request details in the same place.
a
Unfortunately, even with the interceptors, it's not possible to log all request headers because the engines add implementation-specific headers before sending the request.
c
I wanted to read those for error analytics reporting, but for now, we will only report headers added by us.