400:错误的请求!

发布于 2024-11-01 06:02:04 字数 1751 浏览 3 评论 0原文

我正在开发一个使用 xmlrpc 服务进行通信的应用程序。我使用 WAMP 开发了 Windows 的服务器端,并且运行得很好。不过,我决定在 Ubuntu 上实现服务器端。因此,我开始下载并安装必要的内容(apt-get install lamp-server^)以及附带的所有内容。当我尝试时,它不起作用,并且出现错误:400:错误的请求。起初,我以为我来自 lamp-server 并且配置错误,所以我将其全部卸载并重新启动所有组件,但我仍然是那个错误!

我正在使用 pear 的 xml_rpc 包(http://pear.php.net/package/XML_RPC/redirected)。看起来它有效,这是给我这个错误的页面源:

---SENT---
POST server5.php HTTP/1.0
User-Agent: PEAR XML_RPC
Host: localhost
Content-Type: text/xml
Content-Length: 309

<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>storeData</methodName>
<params>
<param>
<value><base64></base64></value>
</param>
<param>
<value><string>03-10-2010-16.55.23</string></value>
</param>
<param>
<value><string>popop</string></value>
</param>
</params>
</methodCall>

---END---

---RECEIVED---
HTTP/1.1 400 Bad Request
Date: Wed, 13 Apr 2011 14:31:33 GMT
Server: Apache/2.2.16 (Ubuntu) PHP/5.3.3-1ubuntu9.3 with Suhosin-Patch
Vary: Accept-Encoding
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1

&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML 2.0//EN&quot;&gt;
&lt;html&gt;&lt;head&gt;
&lt;title&gt;400 Bad Request&lt;/title&gt;

&lt;/head&gt;&lt;body&gt;
&lt;h1&gt;Bad Request&lt;/h1&gt;
&lt;p&gt;Your browser sent a request that this server could not understand.&lt;br /&gt;
&lt;/p&gt;
&lt;/body&gt;&lt;/html&gt;

---END---

故障代码:5 故障原因:没有从远程服务器收到 200 OK。 (HTTP/1.1 400 错误请求)

您知道什么会引发该错误吗?有什么提示或线索吗?

提前致谢 !

I am developing an application which uses an xmlrpc service to communicate. I developed the server-side with windows using WAMP and it works pretty well. However, I have decided to implement the server-side on Ubuntu. So I've started downloading and installing what's necessary (apt-get install lamp-server^) and everything which comes with. When I tried it, It didn't work and I got that error : 400 : Bad Request. At first, I thought I came from lamp-server and a bad configuration so I uninstalled it all and started again all components one by one but I still that error !

I'm using pear's xml_rpc package (http://pear.php.net/package/XML_RPC/redirected). And It seems it work, here's the page source which gives me this error :

---SENT---
POST server5.php HTTP/1.0
User-Agent: PEAR XML_RPC
Host: localhost
Content-Type: text/xml
Content-Length: 309

<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>storeData</methodName>
<params>
<param>
<value><base64></base64></value>
</param>
<param>
<value><string>03-10-2010-16.55.23</string></value>
</param>
<param>
<value><string>popop</string></value>
</param>
</params>
</methodCall>

---END---

---RECEIVED---
HTTP/1.1 400 Bad Request
Date: Wed, 13 Apr 2011 14:31:33 GMT
Server: Apache/2.2.16 (Ubuntu) PHP/5.3.3-1ubuntu9.3 with Suhosin-Patch
Vary: Accept-Encoding
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>

</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
</body></html>

---END---

Fault Code: 5 Fault Reason: Didn't receive 200 OK from remote server. (HTTP/1.1 400 Bad Request)

Do you have any idea what could raise that error ? any tips or clue ?

Thanks in advance !

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

故人的歌 2024-11-08 06:02:04

服务器是对的,请求是错误的

你的路径需要以 / 开头

> POST /server5.php HTTP/1.0 User-Agent:
> PEAR XML_RPC Host: localhost
> Content-Type: text/xml Content-Length:
> 309

Server is right, the request is Bad

Your path needs to start with /

> POST /server5.php HTTP/1.0 User-Agent:
> PEAR XML_RPC Host: localhost
> Content-Type: text/xml Content-Length:
> 309
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文