【问题标题】:How to submit to Google Forms?如何提交到 Google 表单?
【发布时间】:2013-11-29 23:07:03
【问题描述】:

我正在尝试将数据提交到 Google 表单,特别是 this form here。这是我试图用来提交到表单的代码。代码执行得很好,但我从未在表单中看到任何数据。此外,该帖子始终返回状态代码 200(稍后在代码中检查)。有什么想法我在这里做错了吗?谢谢!

HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost("https://docs.google.com/forms/d/1EqlHV7Khlb-eONO0ffa_bXEMDcvIzXObt72pnydfW0o/formResponse");

List<BasicNameValuePair> results = new ArrayList<BasicNameValuePair>();
results.add(new BasicNameValuePair("entry.1840528687",gridSquare));
results.add(new BasicNameValuePair("entry.406732602",sourceDb));
results.add(new BasicNameValuePair("entry.369248655",errorType));
results.add(new BasicNameValuePair("entry_331766136",paidUserString));
results.add(new BasicNameValuePair("entry.240391797",version));
results.add(new BasicNameValuePair("draftResponse","[]\n"));
results.add(new BasicNameValuePair("pageHistory","0"));
results.add(new BasicNameValuePair("fbzx","1608817002751623479"));

post.setEntity(new UrlEncodedFormEntity(results));

HttpResponse response=client.execute(post);

【问题讨论】:

    标签: android google-forms


    【解决方案1】:

    事实证明我做得完全正确,只是我使用了错误的值作为输入。基本上我在设置它们时混合了sourceDberrorType。为了解决这个问题,我将输出放入一个简单的 Web 视图中,当它执行时显示表单没有提交。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-11
      • 2016-09-11
      • 1970-01-01
      • 1970-01-01
      • 2012-08-12
      • 1970-01-01
      相关资源
      最近更新 更多