Raspberry Pi Part
2. Create the ios.php file with this command:
sudo nano /var/www/ios.php
4. Edit and save the file as below:
<?php
if (isset($_GET[language]) and isset($_GET[product])) {
print "GET:";
print "\nYour language: " . $_GET[language];
print "\nYour product: " . $_GET[product];
} else if (isset($_POST['name']) and isset($_POST['age'])) {
print "Post:";
print "\nYour name: " . $_POST['name'];
print "\nYour age: " . $_POST['age'];
} else {
print "Wrong request";
}
?>
In this example, parameters used in the GET method are language and product, while parameters used in the POST method are name and age.
5. Test the GET method with the browser:
Invalid HTTP GET:
http://192.168.0.149/ios.php
Valid HTTP GET:
http://192.168.0.149/ios.php?language=objective-c&product=applewatch
iOS Part
1. Write a simple iOS app. See this:
2. Test the app. The results:
GET:
POST:
PHP Manual











































