0

I need to send a Multipart XML POST request to a web service using FLEX/Actionscript. I would prefer to send it using FLEX, but Actionscript would work as well.

Anybody know how to do that?

2 Answers2

0

Use the HTTPService class and Google helps a lot too.

J_A_X
  • 12,857
  • 1
  • 25
  • 31
0

This is typically done using the FileReference class / upload method. You can attach additional values to a parameter object. By the way, Flex components (MXML) get rendered to Actionscript when you compile, so either way, you're doing it with Actionscript.

TroyJ
  • 1,620
  • 1
  • 10
  • 7
  • I did use the FileReference class/upload method. The problem is that unless you are using the AIR runtime, you have to explicitly select the file that has to be sent by using FileReference.browse() method. – GetSecure Apr 28 '11 at 14:08
  • If you are trying to upload a file collected by flash, in a browser, you must have the user select the file. Maybe I misunderstood what you're trying to accomplish. Can you give a little more information about your implementation needs? – TroyJ Apr 28 '11 at 21:26
  • I'm trying to send XML data, but in multipart form. Does that help clarify? – GetSecure Apr 29 '11 at 13:57
  • There is no actual file being sent, this is xml constructed by FLEX and needs to be sent as a 'file' in a multipart form POST - is that possible? (I am working on the project with him) – naspinski Apr 29 '11 at 14:40
  • FileReference is the only way I know to do this as a multi-part, but I'm trying to figure out why you need to post as multi-part. You can post the xml by encoding it, posting it, and decoding it on the server. You can use base64 and url encoding on the client side and reverse it server side. – TroyJ May 03 '11 at 19:38