What is Restful API?
Restful API is a Representational state transfer Application Programming Interface. If we are sending HTML request in the server via API sever give a information in a JSON or XML form. Jason or XML why because those are structure data. It is using various type of HTTP Method. GET,PUT,POST,DELETE.We are also using a SOAP. SOAP is a simple object access protocol.IT is also implementing web services and exchanging data information.RestAPI it is most powerful and very fast. The most popular big company like Amazon, Google, Twitter, Yahoo using Restful API. API also used cloud services.
Step-1. Go to notepad++ or sublime then create a function.php page and save a page XAMPP or WampServer. the htdoc folder in XAMPP or www folder in WAMP on localhost.
<?php
function get_price($find)
{
$softwarequery=array(
"website"=>299,
"blogger"=>348,
"page "=>267
);
foreach($softwarequery as $Query=>$price)
{
if($Query==$find)
{
return $price;
break;
}
}
}
Step-2. Create a index.php page and save a page XAMPP or WAMP sever htdoc folder in XAMPP or www folder in WAMP on localhost.
<?php
header("content-Type:application/json");
include("function.php");
if(!empty($_GET['name']))
{
$name= $_GET['name'];
$price= get_price($name);
if (empty($price))
deliver_response(200,"blogger found",$price);
else
deliver_response(200,"website found",$price);
}
else
{
deliver_response(400,"page not found",Null);
}
function deliver_response($status,$status_message,$data)
{
header("HTTP/1.1 $status $status_message");
$response['status']=$status;
$response['status_message']=$status_message;
$response['data']=$data;
$json_response=json_encode($response);
echo $json_response;
}
?>
OUTPUT-
thanks to give me these information
ReplyDeleteSearch engine optimization is actually the method of getting greater placement in the organic
ReplyDeletesearch results page of Google, Yahoo and also MSN. The online search engine
that matter the best are Google.com with a 62% advertising and marketing portion Yahoo
along with twenty% and also MSN drifting all around along with around 10% in market portion 'that means the internet search
engine you must select is Google.com cause Google.com undoubtedly has the highest percent of individuals are looking on the net.