0

在发布到surveymonkey api时,我期待一个JSON有效负载,但是每当我发送它时,我都会得到一个状态“3”,在他们的文档中是一个无效请求我不确定我应该给api什么来获取我需要的数据背部。我是否遗漏了找回这份调查清单所需的东西?

HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://api.surveymonkey.net/v2/surveys/get_survey_list?api_key=apikey");
            request.Headers.Add("Authorization", "bearer " + responseToken);
            request.ContentType = "application/json";
            request.Method = "POST";
            request.Accept = "*/*";
            request.UserAgent = "WindowsFormApplication3";
            Console.WriteLine(request.UserAgent);
            string listString = "";
            byte[] listData = encoding.GetBytes(listString);
            using (HttpWebResponse listResponse = (HttpWebResponse)request.GetResponse())
            {
                Console.WriteLine("listResponse = " + listResponse);
                bool b = listResponse.GetResponseStream().CanRead;
                using (StreamReader reader = new StreamReader(listResponse.GetResponseStream()))
                {
                    Console.WriteLine(reader.ReadToEnd());
                }
            }
        }
        catch (Exception aProblem)
        {
            System.Diagnostics.Debug.WriteLine(aProblem);
        }
    }

编辑:如果当我使用 get_user_details 而不是 get_survey_list 时它有帮助,我会得到一个有效的响应,它提供了正确的信息

4

0 回答 0