You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# case 1 : static@service.post(accept=('text/plain', 'application/json'))def_service(request):
... ifacceptisinheadersandnotlisted=>406...
# case 2: dynamicdef_get_accept(request):
""" docstring USED by the doc"""
...
returnFalse, accepteddef_get_accept2(request):
""" docstring USED by the doc"""request.validated['res'] =resultreturnTrue, None@service.post(accept=_get_accept)def_service(request):
... thedecoratorcalls_get_accept, andreturnsa406ifFalse
... getacceptcanpreparesomethingtobeusedbythemainfunctiontoreturnaresponse (response.validated['xxx'] =xxx)
request.response=request.validated['res']
The text was updated successfully, but these errors were encountered:
This is to ensure that we are able to return the requested content-type.
If not, return a 406 (Not Acceptable) with the list of possibilities.
See Cornices#8 for design information
The text was updated successfully, but these errors were encountered: