首页 > 解决方案 > 在 PHP 中,通过 CALDAV 协议在 icalendar 中添加事件时,收到未知的 HTTP 状态

问题描述

我正在研究基于使用 PHP 语言通过 CALDAV 协议在 icalendar(iPhone) 中插入事件的项目在 localhost 中,代码工作正常。当使用某些函数将相同的代码添加到服务器时,收到未知的 HTTP 状态。

我尝试使用dataType:"text/plain"并且我尝试了 contentType,仍然没有修复.. 我删除了 ajax 函数.. 直接链接到文件.. 仍然显示错误.. 有时它的显示HTTP/1.1 500 Internal Server Errorhttp/1.1 415 unsupported media type

最后一个请求:

PUT /rpc/calendars/mediaj11/calendar~722ea7444446*******/.ics HTTP/1.1
Host: mail.mediajenie.com:2080
Authorization: Basic **********
User-Agent: cURL based CalDAV client
Accept: */*
Content-type: text/calendar; encoding="utf-8"
Depth: 1
Content-Length: 556

最后回复:

HTTP/1.1 500 Internal Server Error
Date: Fri, 28 Jun 2019 10:10:48 GMT
Server: cPanel
Persistent-Auth: false
Host: mail.mediajenie.com:2080
Cache-Control: no-cache, no-store, must-revalidate, private
Connection: Keep-Alive
Pragma: no-cache
Vary: Accept-Encoding
Content-Length: 3011
Content-Type: text/html; charset=UTF-8
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Set-Cookie: PHPSESSID=5e8045144d7823ac82049d0c7ad40247; path=/
Set-Cookie: horde_secret_key=5e8045144d7823ac82049d0c7ad40247; path=/; domain=mail.mediajenie.com; HttpOnly
Set-Cookie: default_horde_view=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; domain=mail.mediajenie.com
X-Powered-By: PHP/7.2.7

标签: phpcurlcaldavhttp-1.1http-status-code-415

解决方案


推荐阅读