PHP Classes

REST

Recommend this page to a friend!

      Simple REST Server  >  All threads  >  REST  >  (Un) Subscribe thread alerts  
Subject:REST
Summary:Do you know what REST means?
Messages:3
Author:rudie dirkx
Date:2011-08-11 13:07:03
Update:2011-09-29 10:37:54
 

  1. REST   Reply   Report abuse  
Picture of rudie dirkx rudie dirkx - 2011-08-11 13:07:04
I see the 'server'. Where is the REST?

  2. Re: REST   Reply   Report abuse  
Picture of jeffrey Afable jeffrey Afable - 2011-08-12 06:08:31 - In reply to message 1 from rudie dirkx
REST means Representational State Transfer. REST is the architecture used to get the value from SERVER and to Client Page.

A simple example for this,
For Server Side "server.php"
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|<?php
|$val1 = $_GET['val1'];
|$val2 = $_GET['val2'];
|print "Sum of $val1 + $val2 is ". ($val1+$val2);
|?>

For Client Side "client.php"
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|<?php
|$val1 = 2; $val2 = 5;
|$server="http://localhost/server.php?val1=$val1&val2=$val2";
|$return=file_get_contents($server);
|print $return;
|?>

The only difference are that I used Curl at my Class and Curl has more option than simple file_get_contents().

  3. Re: REST   Reply   Report abuse  
Picture of mayasakthi mayasakthi - 2011-09-29 10:37:54 - In reply to message 2 from jeffrey Afable
how to call this service using post method? can you help me. no need to get method. why am saying we are integrate mobile to this service.
sorry for bad engllish..