首页 \ 问答 \ filemaker 16 curl call(filemaker 16 curl call)

filemaker 16 curl call(filemaker 16 curl call)

我有一个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中制定卷曲选项方面有经验?

我在电影制片人16中的脚本调用不起作用,我没有收到错误,但是数据没有成功上传到服务器(这是正确的数据,正确制定,相同的数据在php中工作)


I hav a php script that executes a curl call with filemaker data (the script draws data from my db via php calls).

Filemaker 16 supports curl calls directly.

I want to run the same call using filmmakers insert from url script step.

I managed to build up a call but it is failing, at the beginning with an error (there was no data transferred to the server) and now, without any notifications.

My working PHP script:

    $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);

My curl options on filemaker

"--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\""

Has anybody got experience in formulating curl options in filmmaker 16?

My script call in filmmaker 16 does not work, I do not get an error, but the data is not successfully uploaded to the server (it is ical data, correctly formulated, the same data works in php)


原文:https://stackoverflow.com/questions/44062115
更新时间:2023-05-04 21:05

最满意答案

这是推出的不少主题。 它可能低于系统的线程限制 ,因此它取决于您可以为该作业提供多少资源。

如果您更喜欢使用工作池,则Parallel:ForkManager是一个流行的模块。

该模块的文档为大规模下载器提供了此示例:

use LWP::Simple;
use Parallel::ForkManager;

...

@links=(
  ["http://www.foo.bar/rulez.data","rulez_data.txt"],
  ["http://new.host/more_data.doc","more_data.doc"],
  ...
);

...

# Max 30 processes for parallel download
my $pm = Parallel::ForkManager->new(30);

foreach my $linkarray (@links) {
  $pm->start and next; # do the fork

  my ($link,$fn) = @$linkarray;
  warn "Cannot get $fn from $link"
    if getstore($link,$fn) != RC_OK;

  $pm->finish; # do the exit in the child process
}
$pm->wait_all_children;

LWP :: UserAgent没有LWP :: Simple提供的相同getstore子,但它确实有一个行为相似的mirror方法。


That is quite a few threads to launch. It's probably below the thread limit for your system, so it depends how many resources you have available for the job.

If you'd rather use a worker pool, Parallel:ForkManager is a popular module for that.

The module's documentation offers this example for a mass-downloader:

use LWP::Simple;
use Parallel::ForkManager;

...

@links=(
  ["http://www.foo.bar/rulez.data","rulez_data.txt"],
  ["http://new.host/more_data.doc","more_data.doc"],
  ...
);

...

# Max 30 processes for parallel download
my $pm = Parallel::ForkManager->new(30);

foreach my $linkarray (@links) {
  $pm->start and next; # do the fork

  my ($link,$fn) = @$linkarray;
  warn "Cannot get $fn from $link"
    if getstore($link,$fn) != RC_OK;

  $pm->finish; # do the exit in the child process
}
$pm->wait_all_children;

LWP::UserAgent doesn't have the same getstore sub that LWP::Simple provides, but it does have a mirror method which behaves similarly.

相关问答

更多
  • 我不确定为什么在第一次运行时没有得到OOM错误的第二次运行时会出现OOM错误; 当你运行Perl脚本并且perl二进制文件退出时,它会将所有内存释放回操作系统。 执行之间没有任何内容。 每次REST服务返回的数据是否完全相同? 也许第二次运行时会有更多的数据,它会让你超越边缘。 我注意到的一个问题是你正在启动10个线程并运行它们完成,然后产生10个以上的线程。 更好的解决方案可能是工作线程模型。 在程序开始时生成10个线程(或多个你想要的),将URL放入队列,并允许线程自己处理队列。 这是一个可能有帮助的简 ...
  • 好的,哇。 在那里慢下来。 你在同一个代码中进行threads和fork 。 这是一个非常可怕的想法。 它们在某种程度上依赖于实现 - 你可以非常肯定它们会起作用,但同时它们都要求一个痛苦的世界。 (并发问题,竞争条件等)。 在这种特殊情况下 - 您需要了解fork()所做的是获取进程的完整副本 - 完全相同的状态 - 并且只有一个区别 - fork()的返回代码。 这意味着线程等也将被fork()克隆。 Parallel::ForkManager通过限制并行范围来隐藏其中的一部分,但这就是幕后发生的事情。 ...
  • 正如其他人所提到的,使用多个内核是可能的,但这取决于操作系统决定如何分配线程。 在我指示每个线程运行的位置时,你没有任何控制权。 对于一个非常好的教程,有一些很好的解释和图片,你可以查看这个页面,以及如何使用POSIX库进行多线程的代码。 http://www.pathcom.com/~vadco/parallel.html 睡眠的时间片很难看到,所以最好的办法是测试它,例如,让你的两个线程开始计算每毫秒,看两者是否相同。 如果他们不是,那么至少有一个人会被cpu睡觉。 很可能两者都会在某个时间进入睡眠状态 ...
  • 不是真的。 连接池通过在数据库访问上重用它们来负责消除创建和关闭连接的开销。 如果您有一千个请求,并且maxSize池为20,那么将并行执行20个数据库访问,并且每个请求释放数据库访问权限后,将重复使用相同的连接来参加另一个请求。 这假设数据库访问将在有限的时间段内进行(短操作),并且一旦获取/插入/更新数据,就会释放连接以用于另一个请求。 另一方面,由于池完全正在使用而无法检索数据库连接的请求(假设第21个请求)将处于等待状态,直到某个连接被释放,因此它在客户端是透明的条件。 所有这一切都假设代码以高效的 ...
  • 在访问多线程应用程序中的共享数据时,保护共享数据总是非常重要。 在你的情况下,你有两个线程同时访问标准输出,因此你有一个竞争条件,其中两个线程争夺stdout 。 因此,我已经自由地使您的程序适应标准输出受互斥锁保护的情况。 在使用stdout之前,我们锁定一个互斥锁,另一个线程也会尝试锁定互斥锁,但两者不能同时在同一时间完成。 因此试图锁定的第二个线程进入睡眠状态。 正如其他人告诉你的那样,你最初编写的程序可能看起来很好,或多或少巧合,在其他系统上,你无法保证这两个线程的输出可以混淆。 以输出结束 125 ...
  • 我和你的来源玩了一下,想出了这个: #!/usr/bin/perl use 5.012; use warnings; use threads; use Thread::Queue; use LWP::UserAgent; use constant THREADS => 10; my $queue = Thread::Queue->new(); my @URLs = qw( http://www.collectorsarmoury.com/ http://burgund ...
  • 这是推出的不少主题。 它可能低于系统的线程限制 ,因此它取决于您可以为该作业提供多少资源。 如果您更喜欢使用工作池,则Parallel:ForkManager是一个流行的模块。 该模块的文档为大规模下载器提供了此示例: use LWP::Simple; use Parallel::ForkManager; ... @links=( ["http://www.foo.bar/rulez.data","rulez_data.txt"], ["http://new.host/more_data.doc ...
  • 我不知道是否可以将PPL / ConcRT配置为不使用协作同步或至少限制它创建的线程数。 我认为它可能是通过调度程序策略来控制的,但似乎没有任何策略参数适合此目的。 但是,我有一些建议,您可能会发现有助于缓解这个问题,即使不是以理想的方式: 而不是critical_section ,使用非协作同步原语来保护资源管理器。 我认为(虽然没有检查)经典的WinAPI CRITICAL_SECTION应该成功。 作为这个方向的根本步骤,您可以考虑使用其他并行库作为代码; 例如, 英特尔的TBB提供了大部分PPL A ...
  • 在您启动所有线程后,您想要加入该线程。 你的代码目前所做的是启动一个线程,然后加入,然后启动下一个线程。 这实际上只是让它们按顺序运行。 但是,输出可能不会更改,因为这仅基于首先获取锁定的任何线程。 You want to join the thread after you have kicked off all of the threads. What your code currently does is starts a thread, then joins, then starts the next ...
  • 我想你要在群集中这样做,而不是在同一台机器上的多个线程中,除非你有一台带有多个网络接口卡(NIC)的机器。 你的瓶颈不是核心,而是你的网卡。 您的NIC仍将按顺序清空其缓冲区。 我建议你拥有尽可能多的机器集群。 在每台机器上,有一对线程(只是为了确保NIC的缓冲区保持满)。 不要打扰同步群集以同时发送请求,因为往返时间(RTT)将花费太长时间,它将使您的负载测试无效。 只需让每个Thread锤掉......从统计上讲,只要你的集群足够大,你就必须同时获得几个POST请求。 Id say you would ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。