Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用C#从formstack获取提交的数据?_C#_.net_Error Handling_Integration_Formstack - Fatal编程技术网

使用C#从formstack获取提交的数据?

使用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

我使用此代码从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_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是否正确,标题和它们的值是否正确,你是否遗漏了什么?谢谢你的回复。我正在按你说的核实。你有这方面的例子吗?