【问题标题】:Postman and django rest framework (rest-auth)Postman 和 django 休息框架(rest-auth)
【发布时间】:2021-03-10 12:53:26
【问题描述】:

postman

drf

我使用 drf 和 postman 访问相同的 url,但字段不同。我不明白为什么。 (截图在 postman 和 drf 链接下)

【问题讨论】:

    标签: django django-rest-framework postman django-rest-auth


    【解决方案1】:

    对于 Postman,您使用了 POST 方法
    对于 DRF,您使用了 GET 方法

    您的端点只允许用于 POST 和 OPTIONS,所以难怪您收到消息 method GET is not allowed

    顺便说一句,请注意,您在两种情况下都使用不同的Content-Type

    在浏览器中打开developer's console,您将看到您使用的具体方法。

    【讨论】:

      猜你喜欢
      • 2021-11-26
      • 2014-08-29
      • 2014-01-14
      • 2013-04-08
      • 2021-11-20
      • 2019-06-07
      • 1970-01-01
      相关资源
      最近更新 更多