title: Django: how to set content-type header to text/xml within a class-based view?
body: <p>I'm trying to do it this way, but it doesn't work.</p>
  
  <pre><code>class MyView(View):
  
      def options(self, request, *args, **kwargs):
          """
          Handles responding to requests for the OPTIONS HTTP verb.
          """
          response = http.HttpResponse()
          if self.kwargs.has_key('xml'):
              response['Content-Type'] = 'text/xml; charset=utf-8'
          return response
  </code></pre>