我新写了一个项目来使用闪存做谷歌表单工作。但它不能将任何数据发布到谷歌表单。
提交代码:
var ulpost:URLLoader = new URLLoader()
var url:String = htmlformat.form.data.action
var req:URLRequest = new URLRequest(url)
var vars:URLVariables = new URLVariables()
for (var name:String in dic) {
var eachParam:Object = dic[name] as Object
if (eachParam is TextInput) {
vars[name]=TextInput(eachParam).text
}else if (eachParam is TextArea) {
vars[name]=TextArea(eachParam).text
}else if (eachParam is RadioButtonGroup) {
vars[name] = RadioButtonGroup(eachParam).selection.label
}else if (eachParam is ComboBox) {
vars[name] = ComboBox(eachParam).selectedLabel
}
}
vars['pageNumber']="0"
vars['backupCache']=""
vars['submit']="Submit"
req.data = vars
ulpost.dataFormat = URLLoaderDataFormat.TEXT
req.contentType= "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST
EventCenter.defaultCenter().addObject(Event.COMPLETE,ulpost,evt_ulpost_com)
EventCenter.defaultCenter().addObject(IOErrorEvent.IO_ERROR,ulpost,evt_ulpost_err)
EventCenter.defaultCenter().addObject(HTTPStatusEvent.HTTP_RESPONSE_STATUS, ulpost, evt_ulpost_status)
EventCenter.defaultCenter().addObject(SecurityErrorEvent.SECURITY_ERROR, ulpost, evt_ulpost_err2)
ulpost.load(req)
变量:
submit=Submit&entry%2E5%2Esingle=test&entry%2E1%2Egroup=%E6%99%AE%E9%80%9A&entry%2E7%2Esingle=&entry%2E0%2Egroup=A&pageNumber=0&entry%2E4%2Esingle=game%5FMistyJewel&backupCache=
响应状态:
500
它返回一个错误页面字符串:
<!DOCTYPE html><html lang="en" ><head><meta name="description" content="Web word processing, presentations and spreadsheets"><link rel="shortcut icon" href="//ssl.gstatic.com/docs/spreadsheets/favicon_jfk.png"><title>Google Docs Error</title><link href="//fonts.googleapis.com/css?family=Open+Sans:300" rel="stylesheet" type="text/css"><style>/* Copyright 2012 Google Inc. All Rights Reserved. */
.goog-inline-block{position:relative;display:-moz-inline-box;display:inline-block}* html .goog-inline-block{display:inline}*:first-child+html .goog-inline-block{display:inline}#drive-logo{color:#91959c;font-family:"Open Sans",Arial,sans-serif;font-size:27px;font-weight:300;position:absolute;text-shadow:0 1px 1px white;white-space:nowrap}#drive-logo img{padding:0 0.4em 0 0;position:relative;top:2px;vertical-align:middle}#drive-logo a{color:#91959c;text-decoration:none}#drive-logo span.goog-inline-block{margin-top:3px;vertical-align:top}</style><style type="text/css">body {background-color: #fff; font-family: Arial,sans-serif; font-size: 13px; margin: 0; padding: 0;}a, a: link, a: visited {color: #112ABB;}</style><style type="text/css">.errorMessage {font-size: 12pt; font-weight: bold; line-height: 150%;}</style></head><body><div style="margin: auto; max-width: 750px;"><div style="margin: 80px 40px 20px 40px; position:relative; "><div style="position: absolute; top: -80px;"><h1 id="drive-logo"><a href="/"><img src="//www.google.com/images/logos/google_logo_41.png" width="116" height="41" alt="Google logo" ><span class="goog-inline-block">Drive</span></a></h1></div><p style="padding-top: 15px">Google Docs has encountered a server error. If reloading the page doesn't help, please <a href="http://docs.google.com/support/bin/request.py?hl=en&ctx=docs&contact_type=server_error">contact us</a>.</p><p>We're sorry, a server error occurred. Please wait a bit and try reloading your spreadsheet.<br>To discuss this or other issues, visit the <a href="http://productforums.google.com/forum/#!forum/docs">Google Docs Help forum</a>. To see the list of known problems, check the <a href="http://docs.google.com/support/bin/static.py?hl=en&page=known_issues.cs">Google Docs Known Issues page</a>.</p><p><br><b>Sorry, and thanks for your help!</b><br><i>- The Google Docs Team</i></p></div></div></body></html>
我试过任何方法。但不要工作。后页与网页表单操作 url 相同。
:(
此处的快照:(无法上传)https://docs.google.com/open?id=0ByCQf0ErsQlOVTI3aTJJVVY2S28