title: Sending Json Form from Flash AS3
body: <p>i am having one form accepting json post in Asp.net which i need to call from Flash As3... </p>
  
  <p>i am using  below code to do that. I have seen some post in which they say its working fine.
  But i am encountering below Error </p>
  
  <p><code>Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.</code></p>
  
  <p>Here is my code. </p>
  
  <pre><code>        var messages:Array = new Array ();
  
  
          messages.push({"From":fromemailTxt.text,"To": ToemailTxt.text,"Body": BodyText.text,"Subject":SubjectText.text});
  
          var JsonObj:String = JSON.encode(messages);
          trace(JsonObj);
  
          var variables:URLVariables=new URLVariables(JsonObj);
  
  
  
          RequestURL= srvStringURL;
  
          var JSONLoader:URLLoader = new URLLoader();
          JSONLoader.dataFormat=URLLoaderDataFormat.TEXT;
  
          JSONLoader.addEventListener(IOErrorEvent.IO_ERROR, GetBookmarkURLError, false, 0, true);
          JSONLoader.addEventListener(Event.COMPLETE, parseBookmarkURLResult, false, 0, true);
  
  
          var hdr:URLRequestHeader = new URLRequestHeader("Content-type", "application/json");
  
          var request:URLRequest = new URLRequest(RequestURL);
          request.requestHeaders.push(hdr);
          request.data=variables;
          request.method = URLRequestMethod.POST;
  
          try 
          {
              JSONLoader.load(request);
          }
          catch (error:ArgumentError) 
          { 
              trace("An ArgumentError has occurred."+error.errorID.toString()); 
          } 
          catch (error:SecurityError) 
          { 
              trace("A SecurityError has occurred."); 
          }
          catch (error:Error) 
          {
              trace("Unable to load requested document.");
          }
  </code></pre>
  
  <p>Anybody have any idea on this??
  Thanks </p>