Hi Pete,

Thanks. I was hoping I could do something like that but Flexbuilder complains about anything but the two standard types of application/url form encoded and application/xml. While text/plain is an acceptable option for forms, Flex apparently doesn't like it. Perhaps it's just a warning and not an error. I'll have to try that again to see.

The tech on the server is just an API so I can't change that end of it.

Many thanks,

Michael

Peter Farland wrote:

If you're using HTTPService, I think you may be able to set the contentType to something else like "text/plain" and prepare the string for the POST yourself manually? It may be simpler to decode the form params on the other end before invoking your API... what technology are you using on the server? Pete

------------------------------------------------------------------------
*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Michael Wills
*Sent:* Tuesday, April 10, 2007 9:48 PM
*To:* flexcoders@yahoogroups.com
*Subject:* [flexcoders] HTTPService where parameter has hypen or underscore and bypassing automatic form encoding of data with bytearray?

Hello all,

I am using Flex to access an API that has parameters with a hyphen or an underscore in the name of the parameter. If the parameter name has a hyphen, Flexbuilder (2.0.1) does not compile with a syntax error. Putting the name part in quotes causes the hyphen to be form encoded If it has an underscore, it compiles fine, but the name parameter becomes form encoded and so the hyphen is no longer passed as a hyphen. For example:

sample-param: "sample value", <-- causes syntax error
'sample-param': "sample value", <-- compiles OK but becomes sample%2Dparam which API doesn't recognize sample_param: "sample value" <-- compiles OK but becomes sample%5Fparam which API doesn't recognize

Using myQueryObject['sample-param'] has the same effect as the above of course.

One other related issue is passing a delimiter in the value. For example:

sample-param: "val1:val2:val3" <-- colon is encoded to %3A which API doesn't recognize.

Is there a way to pass this data directly without going through this kind of encoding? Perhaps I would need to use a byte array or something like that? I'll start digging in that direction.

Thanks in advance,

Michael

Reply via email to