小编bwe*_*est的帖子

Amazon S3是否支持基本身份验证的HTTP请求

我想设置一个Amazon S3帐户,创建一个存储桶,上传一些数据,并且使用HTTP GET 和基本身份验证可以获得这些数据.

我知道有几种方法可以对S3数据进行身份验证(查询字符串等),但我希望能够为身份验证提供简单的用户名/密码方案.

这可能吗?

amazon-s3 amazon-web-services

50
推荐指数
6
解决办法
5万
查看次数

如何使用(发送网格)php api在列表中添加联系人

我正在尝试使用php api在列表中添加联系人,但它正在抛出波纹管代码片段错误

string(51)"{"errors":[{"message":"请求正文无效"}]}"{"email":"hello@test.com","first_name":"hh","last_name" :"用户"}

我使用的是以下代码段:

$url = 'https://api.sendgrid.com/v3';
$request =  $url.'/contactdb/lists/12345/recipients';  //12345 is list_id
$params = array(
'email' => 'hello@test.com',
'first_name' => 'hh', 
'last_name' => 'User'
  );
$json_post_fields = json_encode($params);
// Generate curl request
$ch = curl_init();
$headers = 
array("Content-Type: application/json",
"Authorization: Bearer SG.XXXXXXXX");
curl_setopt($ch, CURLOPT_POST, true);   
curl_setopt($ch, CURLOPT_URL, $request);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
// Apply the JSON to our curl call
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_post_fields);
$data = curl_exec($ch);
if (curl_errno($ch)) {
print "Error: " . …
Run Code Online (Sandbox Code Playgroud)

php email curl sendgrid

13
推荐指数
2
解决办法
4867
查看次数

我的ASP.Net代码可以从sendgrid确认已发送电子邮件吗?

我有我在我的应用程序中使用的代码:

    private async Task configSendGridasync(IdentityMessage message)
    {
        var myMessage = new SendGridMessage();
        myMessage.AddTo(message.Destination);
        myMessage.From = new System.Net.Mail.MailAddress(
                            "a@b.com", "AB Registration");
        myMessage.Subject = message.Subject;
        myMessage.Text = message.Body;
        myMessage.Html = message.Body;

        var credentials = new NetworkCredential(
                   ConfigurationManager.AppSettings["mailAccount"],
                   ConfigurationManager.AppSettings["mailPassword"]
                   );

        // Create a Web transport for sending email.
        var transportWeb = new Web(credentials);

        // Send the email.
        if (transportWeb != null)
        {
            await transportWeb.DeliverAsync(myMessage);
        }
        else
        {
            Trace.TraceError("Failed to create Web transport.");
            await Task.FromResult(0);
        }
    }
Run Code Online (Sandbox Code Playgroud)

它在这里被称为:

    public async Task<IHttpActionResult> Register(RegisterBindingModel model)
    { …
Run Code Online (Sandbox Code Playgroud)

asp.net email asp.net-mvc sendgrid asp.net-web-api

9
推荐指数
2
解决办法
1673
查看次数

AWS API Gateway 删除响应标头

我使用 AWS api 网关创建了一个 API,其中包含一个模拟端点/test

在我的回复中,我得到了标题x-amzn-RequestIdx-amz-apigw-id. 如果出现错误,例如使用不存在的端点/test2,我也会得到x-amazn-ErrorType标头。

我不希望这些 aws 标头出现在我的 api 响应中。如何去除这些?

api amazon-web-services aws-api-gateway

9
推荐指数
1
解决办法
1003
查看次数

什么是静态站点生成器?

放弃Wordpress后,我一直在试验Jekyll创建一个博客.我选择它(通过Ghost)来帮助我在博客时学习Web开发的基础知识.此外,GitHub页面上的免费托管是整洁和免费的.

什么是静态站点生成器(如Jekyll),为什么它们存在?

static-site jekyll

7
推荐指数
1
解决办法
512
查看次数

在C#中使用X-SMTPAPI的Sendgrid字符编码标头

我正在使用SendGridPlus API发送带有SendGrid的电子邮件.一切正常.但我有一个西班牙字符的问题,á或者é当我将它们包含在标题中的替换值时.

例如,如果我包括Que día más bueno hace我收到Que d?a m?s bueno hace.

这是代码:

       [Test]
    public void TestSendGrid()
    {
        //create a new message object
        var message = Mail.GetInstance();
        var recipients = new List<string>();

        //You could loop through your dataset here and add each recipient, up to 1000 recipients per message
        recipients.Add("juanp_perez@loyaltycrm.com");
        recipients.Add("juanp_perez@msn.com");

        //We want to add the recipients to the X-SMTPAPI header
        message.Header.AddTo(recipients);

        //Even though we added recipients to the Header, the …
Run Code Online (Sandbox Code Playgroud)

c# sendgrid

6
推荐指数
1
解决办法
3530
查看次数

滚动到页面底部时如何加载disqus?

我看到一些jekyll博客使用disqus作为评论,评论部分不会加载,直到你滚动到页面底部.

我怎么处理这个?

我尝试过这样的事情:

<div id="disqus_thread"></div>
<div id="disqus_loader" style="text-align: center">
<button onclick="load_disqus()">Load Disqus Comments</button>
<script>
function load_disqus()
{
  var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
  dsq.src = "http://[YOUR-DISQUS-SHORTNAME].disqus.com/embed.js";
  (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  var ldr = document.getElementById('disqus_loader');
  ldr.parentNode.removeChild(ldr);
}
</script>
</div>
Run Code Online (Sandbox Code Playgroud)

单击按钮以加载disqus.但我想知道当我滚动到页面底部时如何加载它.

javascript disqus

5
推荐指数
1
解决办法
1960
查看次数

SendGrid 修改电子邮件中的链接,它们不会重定向到正确的页面

我有一个使用 sengrid 在生产中运行的 rails 应用程序。在我的应用程序中,我发送了一封带有确认链接的电子邮件,该链接重定向到特定的确认页面:

%a.button.button-custom.button-blue{href: confirm_votes_path(@vote.confirmation_token, only_path: false)
Run Code Online (Sandbox Code Playgroud)

但是在生产中,Sengrid 似乎修改了我邮件中的链接。我得到类似的东西:

href="https://u3881616.ct.sendgrid.net/wf/click?upn=pVistOUxWTXmIPFqqAw0AnJt-2BbCLbreZ3xbCIcCjU0qXsxlkph8Wd3VafON-2FVyJfT0PWClbesX-2F2oOjnxeXwwaDA80aCKixoULvRGUX7PgDg59Vde4HU6spxlzuqyUUF_e4qGN2gUHpERWs59wU8LHyeuQCdWWdC4Yjpw10HvUcUonj0ZfIp-2FiYACT83qOqsHMBnkJGcBsjpIoSUjVySxVhEtqCz7myXFB-2B7uTWKruQbH-2BG7-2FI2-2BFdmXC6nbf-2FFpgyNUivvir0Upib8e5r8YJY3caF-2BpKD-2FscuINwBQkM7n008mEGADo5w5w5fejlzhopGHvJegbSRePJ-2BBu3b3olUhP2q-2BX4lyJAYvegG4xnDPU-3D"
Run Code Online (Sandbox Code Playgroud)

并且链接重定向到我网站的基本网址,而不是像本地那样好的确认网址。

SendGrid在这里发生了什么

email ruby-on-rails sendgrid

5
推荐指数
1
解决办法
2687
查看次数

使用Web Audio API将多个ArrayBuffer合并/分层为一个AudioBuffer

我需要分层循环.wav轨道,最终我将需要能够打开和关闭并保持同步。

首先,我加载了曲目,并停止BufferLoader了将加载的内容arraybuffer变成的AudioBuffer(因此false

        function loadTracks(data) {
            for (var i = 0; i < data.length; i++) {
                trackUrls.push(data[i]['url']);
            };
            bufferLoader = new BufferLoader(context, trackUrls, finishedLoading);
            bufferLoader.load(false);
            return loaderDefered.promise;
        }
Run Code Online (Sandbox Code Playgroud)

当您单击屏幕上的按钮时,它将调用startStop()

    function startStop(index, name, isPlaying) {
        if(!activeBuffer) {
            activeBuffer = bufferList[index];
        }else{
            activeBuffer = appendBuffer(activeBuffer, bufferList[index]);
        }
        context.decodeAudioData(activeBuffer, function(buffer){
            audioBuffer = buffer;
            play();
        })


    function play() {
        var scheduledTime = 0.015;
        try {
            audioSource.stop(scheduledTime);
        } catch (e) {}

        audioSource = context.createBufferSource();
        audioSource.buffer = …
Run Code Online (Sandbox Code Playgroud)

javascript merge arraybuffer audiobuffer web-audio-api

4
推荐指数
1
解决办法
2690
查看次数

在表单<select>元素中,如何使用onchange事件处理程序直接链接到所选选项?

这是我过去用于非wordpress网站的内容:

function goThere() {
    var list = document.forms[0].articles
    location = list.options[list.selectedIndex].value
}
Run Code Online (Sandbox Code Playgroud)

调用该函数的select元素:

<form>
<select id="articles" name="articles" onchange="goThere()">
 <option value="#" selected>Choose an article</option>
 <option value="document1.pdf">Document 1</option>
 <option value="document2.pdf">Document 2</option>
 <option value="document3.pdf">Document 3</option>
</form>
Run Code Online (Sandbox Code Playgroud)

javascript forms text widget

2
推荐指数
1
解决办法
413
查看次数

检索通过SendGrid发送的电子邮件的状态

我正在使用Microsoft Windows Azure云平台的c#中创建一个应用程序。

我需要知道如何使用azure上托管的SendGrid服务跟踪电子邮件。跟踪状态可能是。

4. Track sent emails to determine if they were:
4.1 delivered
4.2 opened
4.3 recipient opt-out
4.4 bounced (with the reason for the bounce)
4.5 time/date sent
4.6 which links in the email were clicked (and time/date they were clicked)
4.7 IP address, if user clicked any links in the email  
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激。

.net email azure sendgrid

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