Skip to content

Instantly share code, notes, and snippets.

@JordanMilne
Created January 16, 2014 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JordanMilne/8463450 to your computer and use it in GitHub Desktop.
Save JordanMilne/8463450 to your computer and use it in GitHub Desktop.
setting the Content-Type header with flash
<?xml version="1.0"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark" >
<fx:Script><![CDATA[
import flash.net.*;
public function sendStuff():void
{
var r:URLRequest = new URLRequest('http://www.youtube.com/foo');
r.method = 'POST';
r.data = '{wow what a great post body}';
r.contentType = "application/whoknows";
sendToURL(r);
}
]]></fx:Script>
<s:Button label="Send some stuff" click="sendStuff();" />
</s:Application>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment