您如何将数据发布到多页Google表单? [英] How do you POST data to a multi-page google form?

查看:110
本文介绍了您如何将数据发布到多页Google表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过POST自动填写Google表单.但是,当我实际将数据发布到其中时,实际上只填写了第一页的问题.

I'm trying to auto-fill a google form via POST. However when I actually POST the data to it, only the first pages questions actually get filled.

示例代码:

    private static void PostToFormTest()
    {
        WebClient client = new WebClient();
        var keyValue = new NameValueCollection();
        keyValue.Add("entry.843521592", "Option 1");
        keyValue.Add("entry.901429584", "Test Right Now");
        keyValue.Add("entry.347619935", "Test Page 2");
        Uri uri = new Uri("https://docs.google.com/forms/d/1zuQxyoRUQ-jYwTf7wrPu9Wqln8ec7gfhzRbOILD3LGU/formResponse");
        byte[] response = client.UploadValues(uri, "POST", keyValue);
        string result = Encoding.UTF8.GetString(response);

    }

响应表:

https://docs.google.com/spreadsheets/d/1B4OSjQRQ37Q5Dt4mxMAx0wx5LfyajvWf_5rCY4lOvBU/edit?usp = sharing

表格:

https://docs.google.com/forms/d/1zuQxyoRUQ- jYwTf7wrPu9Wqln8ec7gfhzRbOILD3LGU/viewform

推荐答案

您正在发布到仅包含两个键值对的URL:

You are posting to a URL that only has 2 of the key value pairs:

// On page #1.
keyValue.Add("entry.843521592", "Option 1");
keyValue.Add("entry.901429584", "Test Right Now");

// On page #2.
keyValue.Add("entry.347619935", "Test Page 2");

第二页的值无法添加,因为发布到第一页时不存在该问题.

The value for the second page cannot be added as the question does not exist when you post to the first page.

这篇关于您如何将数据发布到多页Google表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆