Don't reinvent the wheel - use Django's content type parsing