Return to Snippet

Revision: 51510
at September 27, 2011 07:37 by parkerkrhoyt


Initial Code
public function create( className:String, value:Object ):void
{
  var authorization:String = null;			
  var request:URLRequest = null;	
  var header:URLRequestHeader = null;			

  authorization = Base64.encode( APPLICATION_ID + ":" + MASTER_KEY );			
  header = new URLRequestHeader( "Authorization", "Basic " + authorization );						

  request = new URLRequest( "https://api.parse.com/1/classes/" + className );
  request.method = URLRequestMethod.POST;
  request.contentType = "application/json";
  request.data = JSON.encode( value );
  request.requestHeaders.push( header );

  if( loader == null )
  {
    loader = new URLLoader();				
  }

  loader.addEventListener( Event.COMPLETE, doCreateComplete );
  loader.load( request );			
}

Initial URL

                                

Initial Description

                                

Initial Title
Create an Object on Parse

Initial Tags

                                

Initial Language
ActionScript 3