Using an OPTIONS HTTP request details a JSON representation of all PUT and
POST methods but ignores, say, GET requests. Is there a better (less
fragile) way to allow listing of a GET api other than the following:
class MySimpleMetadata(metadata.SimpleMetadata):
def determine_actions(self, request, view):
'''
Adds the GET HTTP method to the methods for which an OPTIONS HTTP
method request returns metadata for
Based on the implementation of determine_actions in super class in
django rest framework version 3.3.3
'''
actions = super(SimpleMetadata, self).determine_actions(request,
view)
actions['GET'] = self.get_serializer_info(view.get_serializer())
return actions
Thanks!
Oded
--
You received this message because you are subscribed to the Google Groups
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.