相关疑难解决方法(0)

AWS Lambda函数可以调用另一个吗?

我有2个Lambda函数 - 一个产生报价,一个将报价转换为订单.我希望Order lambda函数调用Quote函数来重新生成引用,而不是仅从不受信任的客户端接收它.

我看到了我能想到的所有地方 - 但看不出我是如何进行链接或调用功能的......当然这存在!

amazon-web-services node.js aws-lambda aws-api-gateway

280
推荐指数
10
解决办法
14万
查看次数

Slack PHP API - 避免超时错误

我正在尝试使用Slack Custom命令,并且不太确定如何使用延迟消息,因为Yoda Speak External API需要3秒以上的响应时间.

我做了以下事情:

  • /Yoda在我的情况下发送了slack命令并收到了reponse_url.
  • post对响应URL 使用以下内容.
$data_string = '{"response_type": "in_channel", "text":"Checking,please wait..."}' ;
$chs = curl_init();
curl_setopt($chs, CURLOPT_URL, $response_url);
curl_setopt($chs, CURLOPT_POST, true);
curl_setopt($chs, CURLOPT_POSTFIELDS, $data_string); 
curl_setopt($chs, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($chs, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($chs, CURLOPT_RETURNTRANSFER, true);
curl_setopt($chs, CURLOPT_POST, 1);
curl_setopt($chs, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
$results = curl_exec($chs);
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

  • 现在,当我调用Yoda API时,它会出现以下错误"已达到超时".我读到延迟回复,但不知道我应该怎样从这里开始.
$chsres = curl_init();
curl_setopt($chsres, CURLOPT_URL, "https://yoda.p.mashape.com/yoda?sentence=welcome+to+stack");
curl_setopt($chsres, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($chsres, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($chsres, CURLOPT_VERBOSE, true);
curl_setopt($chsres, CURLOPT_TIMEOUT, 45);
curl_setopt($chsres, CURLOPT_RETURNTRANSFER, true);
curl_setopt($chsres, CURLOPT_HTTPHEADER, array('Content-Type:application/json', "X-Mashape-Key:> …
Run Code Online (Sandbox Code Playgroud)

php curl timeout slack-api slack

10
推荐指数
1
解决办法
4283
查看次数