Function based views don't support HTTP HEAD method by default #8007
Unanswered
Doomse
asked this question in
Ideas & Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I recently noticed that the default value for the allowed HTTP methods, specified in the
api_view
decorator for function based views, includes the GET method but not the HEAD method (actually it is just['GET']
).This seemed rather odd to me, since the class based views support the HEAD method as soon as GET is supported by just executing the get() function and stripping the content from the response afterwards (at least that's my understanding of how it works).
As soon as one uses
api_view(['GET', 'HEAD'])
for a function based view, the same thing happens.But if that works fine, why not just have
['GET', 'HEAD']
be the default value forapi_view
in the first place?Beta Was this translation helpful? Give feedback.
All reactions