zoukankan      html  css  js  c++  java
  • 401 403

    class NotAuthenticated(APIException):
    status_code = status.HTTP_401_UNAUTHORIZED
    default_detail = _('Authentication credentials were not provided.')
    default_code = 'not_authenticated'


    class PermissionDenied(APIException):
    status_code = status.HTTP_403_FORBIDDEN
    default_detail = _('You do not have permission to perform this action.')
    default_code = 'permission_denied'


    HTTP response status codes - HTTP | MDN https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
    401 Unauthorized
    Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response.
    403 Forbidden
    The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401, the client's identity is known to the server.


  • 相关阅读:
    ERROR: epmd error for host "yourhostname": timeout
    leetcode485
    leetcode463
    leetcode496
    leetcode344
    leetcode412
    leetcode500
    leetcode476
    leetcode557
    leetcode461
  • 原文地址:https://www.cnblogs.com/rsapaper/p/13215623.html
Copyright © 2011-2022 走看看