使用C#从formstack获取提交的数据?
我使用此代码从formstack获取表单的Sumbit数据使用C#从formstack获取提交的数据?,c#,.net,error-handling,integration,formstack,C#,.net,Error Handling,Integration,Formstack,我使用此代码从formstack获取表单的Sumbit数据 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Net; //webClient using System.IO; // use for StreamReader namespace Test_to_integrate_Form
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net; //webClient
using System.IO; // use for StreamReader
namespace Test_to_integrate_FormStack
{
class Program
{
static void Main(string[] args)
{
var uri = string.Format("https://www.formstack.com/api/v2/submission/:313004779.json");
try
{
using (var webClient = new WebClient())
{
webClient.Headers.Add("Accept", "application/json");
webClient.Headers.Add("Authorization", "apikey" + "4D6A94162B2");
string Response = string.Empty;
Response = webClient.DownloadString(uri);
}
}
catch (WebException we)
{
using (var sr = new StreamReader(we.Response.GetResponseStream()))
{
}
}
}
}
}
它给了我一个错误:远程服务器返回了一个错误:(400)错误请求
我错在哪里?请务必让我知道
谢谢我知道游戏进行得太晚了,但是身份验证在我看来不正确 它应该是“承载[API密钥]”您的URL不正确 您使用了: 但它应该是: 文档显示/:id,这意味着它需要一个变量
仔细检查您正在使用的文档,以确保您正确编写了请求。如错误所述,您正在生成和发送的请求无效。你的url是否正确,标题和它们的值是否正确,你是否遗漏了什么?谢谢你的回复。我正在按你说的核实。你有这方面的例子吗?