I have defined some interfaces when using drf-swagger
, they need to specify accept parameters in order to return the content correctly. For example, I will return a file for download. Obviously, the application/JSON
parameter cannot provide the correct format. I want to be able to add new options to the response content type. There may already be a solution, but I didn't find it ~
To add additional response content type you should take a look at DRF renderers . drf-yasg
works on top of drf
, eg see get_produces()
code .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.