This is my code:
class lista_libros(APIView):
def post(self, request, format=None): #, format=None
cadena64 = request.data
xmlfile = base64.b64decode(cadena64)
#serializer = PruebaSerializer(data = xmlfile)
#if serializer.is_valid():
#serializer.save()
#return Response(serializer.data, status=status.HTTP_201_CREATED)
return Response(xmlfile)
This is what I get:
<?xml version="1.0" encoding="utf-8"?>
<root><libro>
<nombre>Juego de tronos</nombre>
<autor>Pablo Perez.</autor>
<categoria>Fantasia</categoria>
<editorial>Mexicana</editorial>
<fecha_pub>1992</fecha_pub>
<no_pag>5000</no_pag>
</libro></root>
Why the lower and greater than symbols appear like < and > instead < and >
this code is just for trying to POST a base64 string and decode it into a xml file.