我使用这段代码从formstack中获取表单的总和数据
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) Bad Request。
我应该错在哪里?请务必让我知道。
谢谢
发布于 2017-10-03 04:56:24
我知道现在已经很晚了,但是在我看来身份验证是不正确的。
应为“持有者API密钥”
发布于 2021-05-09 18:23:20
https://stackoverflow.com/questions/42803898
复制相似问题