The Google App Engine has no cURL support, which means that all REST calls need to be executed using file_get_contents.
As Parse REST calls need to be secure, you need to make sure that you send the request with a proper SSL context.
Short example of adding data using the Parse REST API from a Google App Engine application:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
$data = array('data1' => 1113, 'data2' => 'Alex', 'data3' => false); $context = array( "ssl"=>array( "allow_self_signed"=>true, "verify_peer"=>false, ), 'http'=> array( "method" => "post", "header" => "X-Parse-Application-Id: YourAppID\r\n" . "X-Parse-REST-API-Key: YourRESTID\r\n" . "Content-Type: application/json\r\n", "content" => json_encode($data) ) ); $context = stream_context_create($context); $result = file_get_contents("https://api.parse.com/1/classes/yourClass", false, $context); |