Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php check method of http request

<?php

$method = $_SERVER['REQUEST_METHOD'];

switch ($method) {
  case 'GET':
    //Here Handle GET Request
    echo 'You are using '.$method.' Method';
    break;
  case 'POST':
    //Here Handle POST Request
    echo 'You are using '.$method.' Method';
    break;
  case 'PUT':
    //Here Handle PUT Request
    echo 'You are using '.$method.' Method';
    break;
  case 'PATCH':
    //Here Handle PATCH Request
    echo 'You are using '.$method.' Method';
    break;
  case 'DELETE':
    //Here Handle DELETE Request
    echo 'You are using '.$method.' Method';
    break;
  case 'COPY':
      //Here Handle COPY Request
      echo 'You are using '.$method.' Method';
      break;

  case 'OPTIONS':
      //Here Handle OPTIONS Request
      echo 'You are using '.$method.' Method';
      break;
  case 'LINK':
      //Here Handle LINK Request
      echo 'You are using '.$method.' Method';
      break;
  case 'UNLINK':
      //Here Handle UNLINK Request
      echo 'You are using '.$method.' Method';
      break;
  case 'PURGE':
      //Here Handle PURGE Request
      echo 'You are using '.$method.' Method';
      break;
  case 'LOCK':
      //Here Handle LOCK Request
      echo 'You are using '.$method.' Method';
      break;
  case 'UNLOCK':
      //Here Handle UNLOCK Request
      echo 'You are using '.$method.' Method';
      break;
  case 'PROPFIND':
      //Here Handle PROPFIND Request
      echo 'You are using '.$method.' Method';
      break;
  case 'VIEW':
      //Here Handle VIEW Request
      echo 'You are using '.$method.' Method';
      break;
  Default:
    echo 'You are using '.$method.' Method';
  break;
}


?>
Comment

php check request method

$_SERVER['REQUEST_METHOD']
Comment

PREVIOUS NEXT
Code Example
Php :: I wanna add new tab clientarea in whmcs 
Php :: OroCRM Custom Bundle is loaded? 
Php :: create random username and password php 
Php :: disableTimeRanges 
Php :: datetime confict function php 
Php :: php send POST request same folder 
Php :: breaking long array in php 
Php :: check file extension in php 
Php :: upgrade phpopensuse 
Php :: phpunit exception message contains string 
Php :: Laravel : Pass dynamic variables to routes 
Php :: get array first element key php 
Php :: how to color php text 
Php :: wpmu assign user to blog 
Php :: validation ignored rules 
Php :: php get image from folder as array 
Php :: laravel api routes 
Php :: vendor folder command for custom errors laravel 
Php :: php send to message to mobile number using springedge 
Php :: Laravel 7 view @php 
Php :: laravel file permission denied 
Php :: laravel array update 
Php :: run php with xampp 
Php :: how to create php message 1 
Php :: return true false laravel 
Php :: Embed the site when you click on the link laravel 
Java :: how to print hello world in java 
Java :: how to clear terminal in java 
Java :: know the version of maven 
Java :: java iterate through hashmap 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =