To start, I posted this on StackOverflow
I'm using Moya 7.0.4
I need to print the cURL for a network request.
Usually, in Alamofire 4, I would do something like this:
let req = Alamofire.request(someURLRequestConvertible)
debugPrint(req) // will print cURL
My call site for Moya looks like this:
MyMoyaProvider<MyEndPoints>.request(MyEndPoints.login(params)) { (result) in }
I've checked out the documentation for Moya, but I can't seem to get the results I'm looking for. I enabled the NetworkLoggingPlugin but still unsure how to print cURL for certain requests. Can someone help me find the proper way to print the Moya request's cURL to console?
If you initialize your NetworkLoggerPlugin, its cURL flag is set to false by default. Initializing it like NetworkLoggerPlugin(cURL: true), willSendRequest should print the cURL. Does that help?
@BasThomas Yep! Perfect 馃憣馃徏
Cool, thanks @BasThomas I'll close the issue :wink:
Most helpful comment
If you initialize your
NetworkLoggerPlugin, itscURLflag is set tofalseby default. Initializing it likeNetworkLoggerPlugin(cURL: true),willSendRequestshould print thecURL. Does that help?