标签: pardot

使用JavaScript URL模拟JSONP响应

我在WP网站上使用Gravity Forms.我的表单使用Pardot 表单处理程序通过ajax POST到Pardot.我遇到了Pardot处理表单6x的问题,没有其他错误.研究表明,这是因为Pardot不支持CORS或JSONP,因此在使用ajax提交时会陷入循环.当表单处理程序的成功URL设置为引用URL时,它正在处理提交但从未"完成".它在放弃之前尝试6次,处理提交的数据并每次发送新的潜在客户通知电子邮件.

Pardot 帮助文档建议以下解决方案:

通过将表单处理程序的成功和错误URL分别设置为执行成功和错误回调的JavaScript URL,可以模拟JSONP响应.

我不完全确定这意味着什么或如何处理它.我已经做了一些stackoverflowing和谷歌搜索,但我似乎无法绕过如何做到这一点.有人可以帮助澄清这个概念或指出我正确的方向吗?

谢谢!

javascript ajax jsonp cors pardot

10
推荐指数
2
解决办法
2988
查看次数

如何使用 HttpClient 验证 Pardot API

我挣扎了大约一天,试图针对 Pardot API 进行身份验证。它不喜欢我尝试发布消息正文的方式。所以我想发布对我有用的解决方案。如果您有任何提示或替代方案,我想听听。

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

var url = "https://pi.pardot.com/api/login/version/3";

//(Edit) Shorter way to pass the parameters below
//var postData = new List<KeyValuePair<string, string>>
//{
//    new KeyValuePair<string, string>("email", "<value>"),
//    new KeyValuePair<string, string>("password", "<value>"),
//    new KeyValuePair<string, string>("user_key", "<value>")
//};

var postData = new Dictionary<string, string>
{
    {"email", "<value>"},
    {"password", "<value>"},
    {"user_key", "<value>"}
};

var httpContent = new FormUrlEncodedContent(postData);

using (var client = new HttpClient())
{
    HttpResponseMessage response = client.PostAsync(url, httpContent).Result;

    if (response.IsSuccessStatusCode)
    { …
Run Code Online (Sandbox Code Playgroud)

.net c# authentication dotnet-httpclient pardot

5
推荐指数
0
解决办法
1239
查看次数

标签 统计

pardot ×2

.net ×1

ajax ×1

authentication ×1

c# ×1

cors ×1

dotnet-httpclient ×1

javascript ×1

jsonp ×1