How do we debug the request being set over to backend servers?
I'd like to be able to see exactly or print out the full request with headers parameters, etc... that is being sent over to servers whenever I make any request by Moya
It is done by activating a plugin that Moya
Already has it. it is NetworkLoggerPlugin
. I need to change this line of code:
var provider = MoyaProvider<MainAPI>()
with:
var provider = MoyaProvider<MainAPI>(plugins: [NetworkLoggerPlugin(verbose: true)])
MOYA >= 14
let plugin: PluginType = NetworkLoggerPlugin(configuration: .init(logOptions: .verbose))
let provider = MoyaProvider<T>(plugins: [plugin])
Thanks to @Anbu.Karthik