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: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Michael Wills
Sent: Tuesday, April 10, 2007 9:48 PM
To: [email protected]
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