Note that there are some explanatory texts on larger screens.

plurals
  1. POURLLoader strange behavior - incorrect \r\n in header
    primarykey
    data
    text
    <p>I have encountered a really strange behavior of the URLLoader/URLRequest. Take a look at the following code: </p> <pre><code>var loader:URLLoader = new URLLoader(); loader.dataFormat = URLLoaderDataFormat.BINARY; var request:URLRequest = new URLRequest(url); request.method = URLRequestMethod.POST; if (params.action is ByteArray) { params.action = Base64.encodeByteArray(params.action); } var vars:URLVariables = new URLVariables(); for (var paramName:String in params) { vars[paramName] = params[paramName]; } request.data = vars; loader.load(request); </code></pre> <p>And when I check HTTP raw request I see this: </p> <pre><code>POST /actions/send/3882-fba04fd1db5b0ac4f4107dd06632e851 HTTP/1.1 Host: domainname.com Content-Length: 237 Origin: http://anotherdomain.com User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19 Content-Type: application/x-www-form-urlencoded Accept: */* Referer: http://anotherdomain.com/page.html Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: foo=bar Pragma: no-cache Cache-Control: no-cache Content-type: application/x-www-form-urlencoded Content-length: 165 action=BASE64DATABASE64DATABASE64DATABASE64DATABASE64DATABASE64DATABASE64DATA </code></pre> <p>So.. wtf? Why URLLoader inserts <code>\r\n</code> after the <code>Cache-Control: no-cache</code> header? Tried to find a solution, though without any luck.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload