Tag: curl

如何使用php curl在Mandrill中附加excel文件

我正在尝试添加一个excel文件(.xlsx)作为我通过Mandrill API发送的电子邮件的附件。 我在一个PHP文件中使用CURL来发送电子邮件。 excel文件被命名为Report.xlsx。 这里是 Mandrill API使用CURL 的链接 。 这是一个链接另一个问题,通过添加文件path。 我收到以下错误信息: PHPparsing错误:语法错误,/var/www/html/newFolder/EmailAlertSystem/mailchimp-mandrill-api-php/UsageReport.php中意外的“path”(T_STRING) (****这是我的代码的目录) 这是我的php代码发送电子邮件通过Mandrill: $uri = 'https://mandrillapp.com/api/1.0/messages/send.json'; $api_key = 'APIKEY'; $content = 'all the content I want to add'; $content_text = strip_tags($content); $from = 'FROM'; $fromName = 'FROMNAME'; $to = 'TO'; $toName = 'TONAME'; $subject = 'SUBJECT'; $fullName = "FIRSTNAME LASTNAME"; $attachment = file_get_contents('Report.xlsx'); $attachment_encoded […]

当curl返回200时,VBA GET请求返回404

我正在使用Excel(因为数据保存在电子表格中)来查看几千个链接的列表,看看它们是否被破坏,当我使用RESTful获取它们时,AKA是否返回404? 但是,我的VBA代码返回的东西,而不是当我使用curl,在这种情况下,curl是正确的(该网页存在)。 这是我的代码与链接造成麻烦(这是在一个子程序,不用担心): For i = StartRow To EndRow Let copyRange = "H" & i Let writeRange = "T" & i query = Worksheets("Sheet1").Range(copyRange).Value If query = "" Then Else With zipService .Open "GET", query, False End With zipService.send zipResult = zipService.Status Worksheets("Sheet1").Range(writeRange).Value = zipResult End If Next i curl命令行: curl –sL –w “%{http_code} \n” […]