使用POST发送变量

时间:2014-03-23 20:41:54

标签: actionscript-3 post

我正在尝试打开新网址并通过POST方法发送变量,但它只发送GET方法。我试过这段代码:

// create a URLRequest object with the target URL:
var url : String = 'newpage.html';
var urlRequest : URLRequest = new URLRequest(url);

// create a URLVariables object and add all the values you want to send with their identifiers:
var urlVariables : URLVariables = new URLVariables();
urlVariables['formfieldId'] = 'formfieldValue';

// add the urlVariables to the urlRequest
urlRequest.data = urlVariables;

// set the method to post (default is GET)
urlRequest.method = URLRequestMethod.POST;

// use navigateToURL to send the urlRequest, use '_self' to open in the same window
navigateToURL(urlRequest, '_self');

我有这一行URLRequest.method = URLRequestMethod.POST;但是网址不会仅使用POST方法打开GET方法。怎么了?

0 个答案:

没有答案