【问题标题】:filemaker 16 curl callfilemaker 16 卷曲调用
【发布时间】:2017-05-19 22:31:35
【问题描述】:

我有一个 php 脚本,它使用 filemaker 数据执行 curl 调用(该脚本通过 php 调用从我的数据库中提取数据)。

Filemaker 16 直接支持 curl 调用。

我想使用来自 url 脚本步骤的电影制作人插入来运行相同的调用。

我设法建立了一个呼叫,但它失败了,一开始出现错误(没有数据传输到服务器),现在没有任何通知。

我的工作 PHP 脚本:

    $headers = array(
    'Content-Type: text/calendar; charset=utf-8',
    'Expect: ',
    'Content-Length: '.strlen($body)
    );
    $agent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)';
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_USERAGENT, $agent);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
    curl_setopt($ch, CURLOPT_USERPWD, $userpwd);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
    curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
    $res=curl_exec($ch);
    curl_close($ch);
    print_r($res);

我在 filemaker 上的 curl 选项

"--header \"Content-Type: text/calendar; charset=utf-8\" --header \"Expect: \" --header \"Content-Length: "&Length ( $vevent )&"\" --user-agent \"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)\" --basic  --user "&$password&" --request \"PUT\" --data \"@$vevent\""

有没有人在电影制片人 16 中制定卷曲选项的经验?

我在filmmaker 16中的脚本调用不起作用,我没有收到错误,但是数据没有成功上传到服务器(它是ical数据,正确公式,相同的数据在php中有效)

【问题讨论】:

  • 你忘了问问题。
  • 对不起,我的问题是,如何将数据传递给服务器。这适用于我原来的 PHP 脚本,但不适用于 filemaker。

标签: php curl filemaker


【解决方案1】:

看起来您没有正确传递 $vevent 变量。 试试这个:

--data \"" & $vevent & "\""

【讨论】:

  • 谢谢。我现在收到此错误: 。即使我“获取”一个有效的、已经存在的日历条目并尝试“放置”它,我仍然会收到此错误(尽管您的建议有一些进展!)
  • 我建议您将问题标记为已回答并开始另一个问题。并尝试 POST 而不是 PUT
猜你喜欢
  • 2019-07-28
  • 2011-04-14
  • 2015-05-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-12-10
  • 2017-03-05
  • 1970-01-01
相关资源
最近更新 更多