【问题标题】:Post method not available on localhost?本地主机上没有发布方法?
【发布时间】:2020-02-17 13:55:10
【问题描述】:

我正在尝试实现this answer::

import requests

requests.post('http://localhost:8888', data={u'post': u'Andr\xe9 T\xe9chin\xe9'})

当我在 Jupyter 笔记本中按原样运行它时,我得到:

<Response [403]>

好的,所以禁止访问。然后我用我的令牌试一试:

requests.post('http://localhost:8888/tree?token=xxx', data={u'post': u'Andr\xe9 T\xe9chin\xe9'})

但这次我明白了:

<Response [405]>

所以post 方法是不允许的?为什么,我该如何改变?

【问题讨论】:

    标签: python jupyter-notebook localhost httpresponse


    【解决方案1】:

    是的,本地主机中允许使用 post 方法。尝试启动本地服务器,然后使用 post 方法。

    【讨论】:

    • 我认为您的防火墙阻止了该端口,请关闭您的防火墙,然后尝试相同的操作......
    猜你喜欢
    • 1970-01-01
    • 2017-02-08
    • 2011-08-08
    • 1970-01-01
    • 2017-03-16
    • 1970-01-01
    • 1970-01-01
    • 2019-06-29
    • 1970-01-01
    相关资源
    最近更新 更多