You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am downloading a PDF file from a specific URL using .downloadParameters task and everything works fine, PDF is displayed properly. The problem occurs when I receive an error with a JSON in response as I cannot parse and extract data from it to display the received error message.
At the start, before I found the reason, this response did not even display in the Moya NetworkLogger logs and I started to investigate why. As I found out further, it was because there was no response data extracted for the DownloadRequest type requests, and response data is available only for DataRequest and DataStreamRequest types.
extensionDownloadRequest:Requestable{internalfunc response(callbackQueue:DispatchQueue?, completionHandler:@escapingRequestableCompletion)->Self{
if let callbackQueue = callbackQueue {returnresponse(queue: callbackQueue){ handler incompletionHandler(handler.response, handler.request,**nil**, handler.error)}}else{returnresponse{ handler incompletionHandler(handler.response, handler.request,**nil**, handler.error)}}}}
So, the question is: Is there any possible solution to extract response data to display the error message, while performing a file download request?
p.s.: Moya version I am using is 15.0.0
The text was updated successfully, but these errors were encountered:
Hello,
I am downloading a PDF file from a specific URL using .downloadParameters task and everything works fine, PDF is displayed properly. The problem occurs when I receive an error with a JSON in response as I cannot parse and extract data from it to display the received error message.
Example Response Body that the server sends:
At the start, before I found the reason, this response did not even display in the Moya NetworkLogger logs and I started to investigate why. As I found out further, it was because there was no response data extracted for the DownloadRequest type requests, and response data is available only for DataRequest and DataStreamRequest types.
So, the question is: Is there any possible solution to extract response data to display the error message, while performing a file download request?
p.s.: Moya version I am using is 15.0.0
The text was updated successfully, but these errors were encountered: