我想在http链接上上传一个.xml
文件。
为此,我现在使用curl上传.xml
文件。
下面是用于上载文件的curl命令。curl -i -X PUT -H "Content-Type: application/xml; charset=utf-8" -d @"/Desktop/upload_file.xml" http://website.name/
当我这样做时,会出现如下错误:
`HTTP/1.1 405 Method Not Allowed
Date: Sat, 25 Jul 2015 04:40:00 GMT
Server: Apache
Allow: GET,HEAD,POST,OPTIONS
Content-Length: 240
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>405 Method Not Allowed</title>
</head><body>
<h1>Method Not Allowed</h1>
<p>The requested method PUT is not allowed for the URL index.html.</p>
</body></html>`
那么这里的主要错误/问题是什么?这意味着什么?
是网站链接错误还是服务器配置错误?或者我传递的curl命令有错误?
请给出任何解决方案或更正。
简单地说,如何使用
requested method PUT is not allowed for the URL
语言在linux中的网站(http)上上载单个.xml
文件?提前谢谢你。
当做
雅明D
最佳答案
这意味着服务器上未启用Put方法。出于安全目的,默认情况下,许多服务器提供程序不允许使用许多方法。
我希望这些问题能给你答案。
https://serverfault.com/questions/438183/how-to-enable-all-http-methods-in-an-apache-http-server
How to enable and use HTTP PUT and DELETE with Apache2 and PHP?
关于php - 在http链接上上传xml文件时,curl中出现“PUT”错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/31623094/