Also, the {name1:value1, name2:value2} syntax is the equivalent (but slightly more efficient form) of:
var oHeaders:Object = new Object(); oHeaders.foo = 'bar'; oHeaders.boo = 'baz'; httpService.headers = oHeaders; Tracy ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt Sent: Wednesday, July 23, 2008 6:19 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: Construct simple http request header Stick with the object, which is essentially a set of name=value pairs: httpService.headers = {foo:'bar', boo:'baz'}; Note, do not quote the name of the property. Tracy ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ron_mori Sent: Wednesday, July 23, 2008 5:12 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Construct simple http request header Tracy, Thanks - it worked beautifully. For the records: httpService.headers = {'foo':'bar'}; Now, not to seem ungrateful, I need to add two headers. Suggestions? An array resulted in object: object --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "Tracy Spratt" <[EMAIL PROTECTED]> wrote: > > I believe that will send the object in the body of the post, not in the > header. > > > > From a post in the archives, you need to do somethng like: > > httpService. headers = {customHeader: 'foobar'}; > > > > Tracy > > ________________________________ > > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> ] On > Behalf Of Guilherme Blanco > Sent: Wednesday, July 23, 2008 4:08 PM > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > Subject: Re: [flexcoders] Construct simple http request header > > > > var params:Object = new Object(); > params.name = "foo"; > params.value = "bar"; > > service.send(params); > > Cheers, > > On Wed, Jul 23, 2008 at 5:04 PM, ron_mori <[EMAIL PROTECTED] > <mailto:ron_mori%40yahoo.com> > wrote: > > How to add headers to httpService request? > > > > Goal - add request header name:val of 'foo: bar' > > > > Tried: var hdr:Array = [{name:"foo", value:"bar"}]; > > Header has: [object object] > > > > Tried: var hdr:Array = ["foo", "bar"]; > > Header has: [0]:foo, [1]:bar > > > > ideas? > > > > thanks in advance. > > > > > > -- > Guilherme Blanco - Web Developer > CBC - Certified Bindows Consultant > Cell Phone: +55 (16) 9166-6902 > MSN: [EMAIL PROTECTED] <mailto:guilhermeblanco%40hotmail.com> > URL: http://blog.bisna.com <http://blog.bisna.com> <http://blog.bisna.com <http://blog.bisna.com> > > Rio de Janeiro - RJ/Brazil >