httprequest - HTTP URLRequest in Adobe Flex -


I'm trying to create a simple HTML URL, trying to rank Adobe Flex, the code is roughly Sends to:

  Var requestSender: URLLoader = new URLloader (); Var urlRequest: URLRequest = new URLRequest ("http: // localhost: 8888"); Var msg: string = "data = blah"; UrlRequest.data = msg; UrlRequest.contentType = "application / x-www-form-urlencoded"; UrlRequest.method = URLRequestMethod.POST;   

Something closer is produced:

  Post / HTTP / 1.1 Referrer: App: / PersonalSearch.Swf Accept: Text / Xml, App / XML, App / XHTML + XML, ... X-Flash-Version: 10,1,85,3 Content-Type: Application / X-www-Form-URLX Content-Length: 102 Accepting-Encoding: Gzip, deflate User Agent: Mozilla / 5.0 (Windows; U; N-US) ... Host: 127.0.0.1:8888 Connection: Keep-alive data = blah   

What exactly do I want:

  POST / HTTP / 1.1 Content-Type: application / x-www-form-urlencoded Connection: Via close: Accept MDS_777: * / * Host: Lokhost: 8888 Content-Length: 104 Data = Blah   

Anyone know how I accept encoding Removing fields like "Via" and to "close" the connection

How do we receive feedback from the HTTP request?

Thanks Phil

Flash Player gives you Approval-encoding Or Via header via the action script. If you try to do this, you will receive a message like this:

Error # 2096: HTTP request headers can not be set by encryption-encoding action script.

If you are using URL variables, you can try to simplify your code by doing this:

  var variables: URLVariables = New URLVariables (); Variables.data = "blah"; // equals as data = blah variables.data2 = "blah2"; // data2 = blah2 var as the same request header: URLLoader = new URLLoader (); Var urlRequest: URLRequest = new URLRequest ("http: // localhost: 8888"); UrlRequest.method = URLRequestMethod.POST; UrlRequest.data = variable;   

To receive a response, you will need to hear "request.seender" for event.complete :

  requestSender AddEventListener (Event.COMPLETE, FullHandler); Personal Function Full Handler (Event: Event): Zero {// something request.Sender.data (or URLLoader (event.target) .data}}    

Comments