0

I have purpose to send in single response several data types: plain/text (or json) and image as bytes. And I see, how I can set contenttype for my response. So and I can set some multipart type:

response = HttpResponse(my_data, content_type='multipart/alternative')

But how I understand, this way leads to difficulties: I need set also content type header for each part of the response. But I cann't find in docs, how can I do that. And is it possible for django?

Thanks for your ideas

1 Answers1

1

This content type is for mail purposes. It will not be rendered correctly by web browsers. Check this question: Browser support of multipart responses

Insspb
  • 193
  • 10
  • Thanks, I saw that. But I come to conclusion that the answer is old and might lose relevance (from 2009-2014 years dates of answers there for now 2019). And I think actual browsers - may be - now can understand the types. Am I wrong? – Александр Aug 25 '19 at 21:19
  • I see their tests from 2019. So everything the same. No point to implement it. – Insspb Aug 27 '19 at 22:01