dongya4335 2019-03-08 03:23
浏览 270
已采纳

Wordpress XML-RPC POST返回32700错误,安装了php-xml扩展

I am using HTTPie to do a POST request to my local Wordpress installation with the aim of checking if XML-RPC is available and enabled.

http --verify=no POST https://crmpicco.localhost/xmlrpc.php data="<?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>wp.getUsersBlogs</methodName><params><param><value>admin</value></param><param><value>pass</value></param></params></methodCall>"

This returns a 200, however the response has a faultCode:

HTTP/1.1 200 OK
Connection: close
Content-Length: 403
Content-Type: text/xml; charset=UTF-8
Date: Fri, 08 Mar 2019 03:18:43 GMT
Server: Apache/2.4.35 (Unix) OpenSSL/1.0.2p PHP/7.2.11
X-Powered-By: PHP/7.2.11

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
  <fault>
    <value>
      <struct>
        <member>
          <name>faultCode</name>
          <value><int>-32700</int></value>
        </member>
        <member>
          <name>faultString</name>
          <value><string>parse error. not well formed</string></value>
        </member>
      </struct>
    </value>
  </fault>
</methodResponse>

Others with this issue point to having the php-xml extension unavailable, however when I do a php -m | grep -i xml it is showing as installed:

libxml
SimpleXML
xml
xmlreader
xmlrpc
xmlwriter

What am I missing?

  • 写回答

1条回答 默认 最新

  • dqjgf0982 2019-03-11 03:39
    关注

    I had to fallback to using cURL for this. I'm unsure as to what exactly I was doing wrong with HTTPie or if it has a limitation in this regard, however it worked with cURL with:

    curl -k -d '<?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>wp.getUsersBlogs</methodName><params><param><value>user</value></param><param><value>pass</value></param></params></methodCall>' https://crmpicco.localhost/xmlrpc.php

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 Keil uVision5创建project没反应
  • ¥15 mmseqs内存报错
  • ¥15 vika文档如何与obsidian同步
  • ¥15 华为手机相册里面的照片能够替换成自己想要的照片吗?
  • ¥15 陆空双模式无人机飞控设置
  • ¥15 sentaurus lithography
  • ¥100 求抖音ck号 或者提ck教程
  • ¥15 关于#linux#的问题:子进程1等待子进程A、B退出后退出(语言-c语言)
  • ¥20 web页面如何打开Outlook 365的全球离线通讯簿功能
  • ¥15 io.jsonwebtoken.security.Keys