5 Replies Latest reply on Sep 25, 2008 8:12 PM by Newsgroup_User

    how-to do an HTTP HEAD request

    borfgordon
      Hi,
      I need to do an HTTP HEAD request against a URL that yields a PDF and/or word document. The HttpService component takes HEAD as a method but it barfs if the response is not XML. How can I do this?
        • 1. Re: how-to do an HTTP HEAD request
          Level 7

          "borfgordon" <webforumsuser@macromedia.com> wrote in message
          news:gbghvc$g28$1@forums.macromedia.com...
          > Hi,
          > I need to do an HTTP HEAD request against a URL that yields a PDF and/or
          > word
          > document. The HttpService component takes HEAD as a method but it barfs if
          > the
          > response is not XML. How can I do this?

          You can't do anything with a Word document in Flex and can only use a PDF in
          air, so exactly what were you planning to do with it?


          • 2. Re: how-to do an HTTP HEAD request
            borfgordon
            I am using HEAD requests to detect differences in file size on a server rather than streaming down the entire file.
            • 3. Re: how-to do an HTTP HEAD request
              Level 7

              "borfgordon" <webforumsuser@macromedia.com> wrote in message
              news:gbgpep$p9p$1@forums.macromedia.com...
              >I am using HEAD requests to detect differences in file size on a server
              >rather than streaming down the entire file.

              But you said you're returning the file itself...? Why not just return the
              file size?


              • 4. Re: how-to do an HTTP HEAD request
                borfgordon
                Because I don't want to download the entire file unless I need to, and http head method request lets me check the size before downloading. Regardless, for puposes of this forum post it does not matter what I am doing with the file.

                Point is that I need to do an HTTP HEAD method request as I am only interested in some resource info. If anyone here knows how to do an HTTP HEAD request via Flex 3 any assistance would be appreciated.
                • 5. Re: how-to do an HTTP HEAD request
                  Level 7

                  "borfgordon" <webforumsuser@macromedia.com> wrote in message
                  news:gbhdh7$jak$1@forums.macromedia.com...
                  > Because I don't want to download the entire file unless I need to, and
                  > http
                  > head method request lets me check the size before downloading. Regardless,
                  > for
                  > puposes of this forum post it does not matter what I am doing with the
                  > file.
                  >
                  > Point is that I need to do an HTTP HEAD method request as I am only
                  > interested
                  > in some resource info. If anyone here knows how to do an HTTP HEAD request
                  > via
                  > Flex 3 any assistance would be appreciated.

                  I don't think HTTPService actually allows anything but GET and POST under
                  normal circumstances. I think it possibly allows other methods if you set
                  useProxy to true, but I don't know what's involved in using a proxy.

                  HTH;

                  Amy