Swift Siesta access response raw data
I've in my API a method that return a content of PDF file. How can I access the raw data of response in success callback? All Siesta responses start out as raw data (in the form of the Foundation type Data ), then run through the transformer pipeline . The default transformer pipeline parses JSON, text, and images based on the Content-type header sent by the server. That list doesn’t include PDF, so if your server is sending a content type of application/pdf (or anything that isn’t a JSON, text, or image content type), the response will still be raw Data at the end of the pipeline: request