2 Replies Latest reply on Mar 3, 2009 2:53 PM by tedalde2

    addRequestHeader doesn't work

    tedalde2 Level 2
      Put this code onto an (AS2) frame (see bottom of this message):

      Run the SWF via Test Movie or from the desktop player. If I examine the request with (a program like) Fiddler, it looks good. addRequestHeader adds the no-cache header values. Here's the request:
      GET / HTTP/1.1
      x-flash-version: 10,0,2,54
      Content-Type: application/x-www-form-urlencoded
      Pragma: no-cache
      Cache-Control: no-cache
      Content-Length: 0
      User-Agent: Shockwave Flash
      Host: some.link.to.xml

      However run the same SWF from a browser and this is the request. No no-cache headers:
      GET / HTTP/1.1
      Accept: */*
      Accept-Language: en-US
      x-flash-version: 10,0,12,36
      UA-CPU: x86
      Accept-Encoding: gzip, deflate
      User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506; .NET CLR 1.1.4322; InfoPath.1)
      Host: some.link.to.xml
      Proxy-Connection: Keep-Alive

      Note the different Flash versions, and the fact that Fiddler reports the request as a GET, not POST; I thought sendAndLoad was always a POST.

      Why does addRequestHeader fail when in a browser? Is it simply the flash player version? That seems unlikely.