首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用C#从表单堆栈中获取提交的数据?

使用C#从表单堆栈中获取提交的数据?
EN

Stack Overflow用户
提问于 2017-03-15 15:53:50
回答 2查看 324关注 0票数 2

我使用这段代码从formstack中获取表单的总和数据

代码语言:javascript
复制
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。

我应该错在哪里?请务必让我知道。

谢谢

EN

回答 2

Stack Overflow用户

发布于 2017-10-03 04:56:24

我知道现在已经很晚了,但是在我看来身份验证是不正确的。

应为“持有者API密钥”

票数 0
EN

Stack Overflow用户

发布于 2021-05-09 18:23:20

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42803898

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档