Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 使用request.post发送url_Python 3.x_Python Requests - Fatal编程技术网

Python 3.x 使用request.post发送url

Python 3.x 使用request.post发送url,python-3.x,python-requests,Python 3.x,Python Requests,在后端,我们设置了一个Selenium脚本来表示易受攻击的客户端。此脚本将单击您发布到以下留言板()的任何链接。您的第一个目标是证明该客户机正在运行。 步骤1:设置服务器向我们的客户端发送一条消息,其中包含指向您页面的链接。使用访问日志验证客户端是否已连接到您的站点 import requests r = requests.post('http://csec380-core.csec.rit.edu:5004/', data={'message':'http://52.14.44.145/'}

在后端,我们设置了一个Selenium脚本来表示易受攻击的客户端。此脚本将单击您发布到以下留言板()的任何链接。您的第一个目标是证明该客户机正在运行。 步骤1:设置服务器向我们的客户端发送一条消息,其中包含指向您页面的链接。使用访问日志验证客户端是否已连接到您的站点

import requests

r = requests.post('http://csec380-core.csec.rit.edu:5004/', data={'message':'http://52.14.44.145/'})

print r.status_code
print r.text
但这是我得到的结果。我不知道如何将我的链接发送到此网站

405
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>405 Method Not Allowed</title>
<h1>Method Not Allowed</h1>
<p>The method is not allowed for the requested URL.</p>
405
405方法不允许
方法不允许
请求的URL不允许使用该方法


看起来您实际上是使用get请求发布到此按摩板的。 试试这个:

r = requests.get('http://csec380-core.csec.rit.edu:5004/process_guest?guest_entry=http://52.14.44.145/')