开发者

Flex HttpService POST limited to 543 Byte per Form field?

开发者 https://www.devze.com 2022-12-22 23:21 出处:网络
I am getting a FaultEvent when trying to send form fields through HTTPService that contain more than 542 chars.

I am getting a FaultEvent when trying to send form fields through HTTPService that contain more than 542 chars.

Initializing the HttpService:

httpServ = new HTTPService();
httpServ.method = 'POST';
httpServ.url = ENDPOINT_URL; //http://localhost:3001/ReportError.aspx
httpServ.resultFormat = HTTPService.RESULT_FORMAT_TEXT;
httpServ.contentType = HTTPService.CONTENT_T开发者_开发知识库YPE_FORM;
httpServ.addEventListener(ResultEvent.RESULT, OnErrorSent);
httpServ.addEventListener(FaultEvent.FAULT, OnFault);

Sending the request:

var params:Object = {};         
//params["stack"] = e.stackTrace.slice(0, 542); //length 542 = works
//params["stack2"] = e.stackTrace.slice(1, 543); //length 542 = works (just to show that it's not about the content itself)
params["stack3"] = e.stackTrace.slice(0, 543); //length 543 = fails

I also seem to be able to create many form fields (with 542 length) so that it's not a limit of the request itself but of the form field:

var params:Object = {};         
params["stack"] = e.stackTrace.slice(0, 542); //length 542
params["stack2"] = e.stackTrace.slice(1, 543); //length 542
params["stack3"] = e.stackTrace.slice(2, 544); //length 542
// Length > 1600 chars

The receiving party is an ASP.NET 4 site on the same domain and port.

I hope someone already came across a similar restrictions or has some general advice on how to trace this problem down further.

Thanks in advance.


I think it might have been a problem with the data I was sending. I am now encoding the data to Base64 and can send large chunks of data without problems.

base64 = new Base64Encoder();
base64.encodeUTFBytes(text);
params['stacktrace'] = base64.flush();
0

精彩评论

暂无评论...
验证码 换一张
取 消