Skip to content

Instantly share code, notes, and snippets.

@steveobbayi
Created November 5, 2018 06:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steveobbayi/e04bef0cc5c06b5b0c91eeaf28321f2a to your computer and use it in GitHub Desktop.
Save steveobbayi/e04bef0cc5c06b5b0c91eeaf28321f2a to your computer and use it in GitHub Desktop.
<?php
$request_method = $_SERVER['REQUEST_METHOD'];
switch ($request_method) {
case 'GET':
//Handle GET Request here
break;
case 'POST':
//Here Handle POST Request here
break;
case 'PUT':
// Handle PUT Request here
break;
case 'PATCH':
// Handle PATCH Request here
break;
case 'DELETE':
//Here Handle DELETE Request
echo 'You are using '.$method.' Method';
break;
case 'COPY':
// Handle COPY Request here
echo 'You are using '.$method.' Method';
break;
case 'OPTIONS':
// Handle OPTIONS Request
break;
case 'LINK':
// Handle LINK Request here
break;
case 'UNLINK':
// Handle UNLINK Request here
break;
case 'PURGE':
//Here Handle PURGE Request here
break;
case 'LOCK':
// Handle LOCK Request here
break;
case 'UNLOCK':
//Here Handle UNLOCK Request here
break;
case 'PROPFIND':
// Handle PROPFIND Request here
break;
case 'VIEW':
//Here Handle VIEW Request
break;
Default:
// Handle default behavior
break;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment