I am currently trying to understand how to use the Response class from DRF. Using Django's HttpResponse, and using the following code:
return HttpResponse("Hello \n World", content_type="text/plain")
I get the following response:
Hello
World
Which is what I am expecting.
However, using the following code:
return Response("Hello \n World", content_type="text/plain")
I get the following response:
"Hello \n World"
Notice how I also get the pair or quotes in the second one "". Since Response is a child of HttpResponse, how can I have the same result using Response? I've come to this problem because I want to present new line characters and tab characters with Response, but I have not been successful so far.
The only the I've seen that might help me was using Renderers from DRF, and making a custom one for plain text. but I do not understand how to apply them to Responses, and I am a bit surprised that DRF doesn't support plain text considering it is a subclass of HttpResponse. Thank you