ds3422222222 2010-07-05 08:44
浏览 200
已采纳

交换WebDAV 400错误请求:为什么?

I have been using WebDAV in PHP directly using XML. I have managed to create emails with attachments and so forth, but when i try to create a contact, I keep getting "400 Bad Request". Here is the webdav query and how i'm executing it:

 <?xml version="1.0"?>
    <g:propertyupdate 
    xmlns:g="DAV:" 
    xmlns:c="urn:schemas:contacts:" 
    xmlns:e="http://schemas.microsoft.com/exchange/" 
    xmlns:mapi="http://schemas.microsoft.com/mapi/" 
    xmlns:x="xml:" 
    xmlns:cal="urn:schemas:calendar:" 
    xmlns:mail="urn:schemas:httpmail:">
    <g:set>
    <g:prop>
    <g:contentclass>urn:content-classes:person</g:contentclass>
    <e:outlookmessageclass>IPM.Contact</e:outlookmessageclass>
    <c:givenName>JoLynn</c:givenName>
    <c:middlename>Julie</c:middlename>
    </g:prop>
    </g:set>
    </g:propertyupdate>

And response:

HTTP/1.1 400 Bad Request
Connection: close
Date: Mon, 05 Jul 2010 08:41:43 GMT
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
Content-Type: text/html
Content-Length: 1709
MS-WebStorage: 6.5.7638

And sending the data: $h->fetch($url, 0, null, $exchange_username, $exchange_password, "PROPPATCH")

Any help greatly appreciated!¬

I started with Troy Wolf's example code at http://www.troywolf.com/articles/php/exchange_webdav_examples.php

  • 写回答

1条回答 默认 最新

  • dongtong0796 2010-07-05 08:54
    关注

    Ah i fixed it, forgot to send some headers with the request (content-type, depth and translate headers to be precise!)

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

报告相同问题?

悬赏问题

  • ¥20 西南科技大学数字信号处理
  • ¥15 有两个非常“自以为是”烦人的问题急期待大家解决!
  • ¥30 STM32 INMP441无法读取数据
  • ¥15 R语言绘制密度图,一个密度曲线内fill不同颜色如何实现
  • ¥100 求汇川机器人IRCB300控制器和示教器同版本升级固件文件升级包
  • ¥15 用visualstudio2022创建vue项目后无法启动
  • ¥15 x趋于0时tanx-sinx极限可以拆开算吗
  • ¥15 pyqt信号槽连接写法
  • ¥500 把面具戴到人脸上,请大家贡献智慧,别用大模型回答,大模型的答案没啥用
  • ¥15 任意一个散点图自己下载其js脚本文件并做成独立的案例页面,不要作在线的,要离线状态。