REST request for service type. Provides method for finding, creating, modifiying service type.
-
POST
Create new service type
- acceptable request format: application/x-www-form-urlencoded
- acceptable request params:
<?xml version="1.0" encoding="UTF-8" ?> | |
<!DOCTYPE html> | |
<html b:version='2' class='v2' expr:dir='data:blog.languageDirection' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'> | |
<head> | |
<!--[if lt IE 9]> | |
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"> </script> | |
<![endif]--> | |
<meta content='width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1' name='viewport'/> | |
<meta content='text/html;charset=UTF-8' http-equiv='Content-Type'/> |
<?php | |
//Database Constant | |
define('DB_NAME', 'test'); //db name | |
define('DB_COLLECTION','friends'); //collection name | |
//Return Paramater Constant | |
define('INSERT_COL_SUCCESS', 0); | |
define('INSERT_COL_FAILED', 1); | |
define('REMOVE_FRIEND_SUCCESS', 0); | |
define('REMOVE_FRIEND_FAILED', 1); |
<?php | |
class dbConnect { | |
private $con; | |
private $db; | |
function __construct() {} | |
//connect to MongoDB function | |
function connect() { | |
include_once dirname(__FILE__) . '/config.php'; |
<?php | |
class dbHandler { | |
private $con; | |
private $col; | |
function __construct() { | |
require_once dirname(__FILE__) . '/dbConnect.php'; | |
$db = new dbConnect(); | |
//Connect to database | |
$this->con = $db->connect(); | |
//Select "friends" collection, already defined in config.php |
<?php | |
require_once '/include/dbHandler.php'; | |
require_once '/lib/Slim/Slim/Slim.php'; | |
Slim\Slim::registerAutoloader(); | |
$app = new Slim\Slim(); | |
//Get All friends end point | |
$app->get('/friends', function() { | |
$db = new dbHandler(); | |
$cur = $db->getAllFriends(); | |
//Variable to store result |
Download the following ZIPs: | |
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links) | |
Download the correct GApps for your Android version: | |
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip) | |
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip) | |
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip) | |
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip) | |
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip) |
<?php | |
require 'vendor/autoload.php' //fitur autoload composer | |
//Inisiasi Slim Framewrok | |
$app = new \Slim\Slim(); | |
//home routing | |
$app->get('/', function(){ | |
echo "Home Base"; //print "Home Base" at http://localhost/slim | |
}); |
RewriteEngine On | |
# Some hosts may require you to use the `RewriteBase` directive. | |
# If you need to use the `RewriteBase` directive, it should be the | |
# absolute physical path to the directory that contains this htaccess file. | |
# | |
# RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f |
RewriteEngine On | |
# Some hosts may require you to use the `RewriteBase` directive. | |
# If you need to use the `RewriteBase` directive, it should be the | |
# absolute physical path to the directory that contains this htaccess file. | |
# | |
RewriteBase /slim | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f |