当前位置: 动力学知识库 > 问答 > 编程问答 >

actionscript 3 - Error sending data to a HTTPS server with as3httpclientlib

问题描述:

I'm trying to send some data from flash to a server. I was doing it with a test server and everything was ok. But when I change to test it into a real server it send me an error: " got Alert! Type=22" So I searched about it and I discover that its because the real server runs on HTTPS and the test runs on HTTP. So, reading the documentation of the as3httpclienlib library that I am using, I found that there is a bug with some HTTPS servers and cause some errors and don't leave flash send more than 40kb of data, so that throws the error Type 22 -> Record overflow

This only happens with TLS Sockets so I think that the solution is change the TLSSocket to a SSLSocket.

This is the code that I use to send the data to the server:

var client:HttpClient = new HttpClient();

var uri:URI = new URI("http://www.snee.com/xml/crud/posttest.cgi");

var variables:Array = [{name:"fname", value:"FirstName1"}, {name:"lname", value: "LastName1"}];

client.listener.onData = function(event:HttpDataEvent):void {

// Notified with response content in event.bytes as it streams in

};

client.listener.onComplete = function(event:HttpResponseEvent):void {

// Notified when complete (after status and data)

};

client.postFormData(uri, variables);

How can I change this sockets?

Does anyone have an example?

Is this the solution of the problem?

分享给朋友:
您可能感兴趣的文章:
随机阅读: