php check method of http request

Solutions on MaxInterview for php check method of http request by the best coders in the world

showing results for - "php check method of http request"
Finn
04 Aug 2016
1<?php
2
3$method = $_SERVER['REQUEST_METHOD'];
4
5switch ($method) {
6  case 'GET':
7    //Here Handle GET Request
8    echo 'You are using '.$method.' Method';
9    break;
10  case 'POST':
11    //Here Handle POST Request
12    echo 'You are using '.$method.' Method';
13    break;
14  case 'PUT':
15    //Here Handle PUT Request
16    echo 'You are using '.$method.' Method';
17    break;
18  case 'PATCH':
19    //Here Handle PATCH Request
20    echo 'You are using '.$method.' Method';
21    break;
22  case 'DELETE':
23    //Here Handle DELETE Request
24    echo 'You are using '.$method.' Method';
25    break;
26  case 'COPY':
27      //Here Handle COPY Request
28      echo 'You are using '.$method.' Method';
29      break;
30
31  case 'OPTIONS':
32      //Here Handle OPTIONS Request
33      echo 'You are using '.$method.' Method';
34      break;
35  case 'LINK':
36      //Here Handle LINK Request
37      echo 'You are using '.$method.' Method';
38      break;
39  case 'UNLINK':
40      //Here Handle UNLINK Request
41      echo 'You are using '.$method.' Method';
42      break;
43  case 'PURGE':
44      //Here Handle PURGE Request
45      echo 'You are using '.$method.' Method';
46      break;
47  case 'LOCK':
48      //Here Handle LOCK Request
49      echo 'You are using '.$method.' Method';
50      break;
51  case 'UNLOCK':
52      //Here Handle UNLOCK Request
53      echo 'You are using '.$method.' Method';
54      break;
55  case 'PROPFIND':
56      //Here Handle PROPFIND Request
57      echo 'You are using '.$method.' Method';
58      break;
59  case 'VIEW':
60      //Here Handle VIEW Request
61      echo 'You are using '.$method.' Method';
62      break;
63  Default:
64    echo 'You are using '.$method.' Method';
65  break;
66}
67
68
69?>
Hanna
28 Jul 2019
1$_SERVER['REQUEST_METHOD']
queries leading to this page
php check put methodhow to check server request type phpget type request phpphp check if get requestsee if there was a get request phpget request method phpsee method type in phpif request method 3d 22get 22 3ahow to find the request typeserver request method in phpphp check request in getphp if request is postcheck type method post or get phpcheck request method in php for apihow to find if request is options phpphp get request typephp get method is postphp know method requestphp check if put 24 request in phphow to get request type in phphow to check http request method in phpget http request method phpphp check the requestphp check if request method is posthow to check request method in phpphp check http methodhow to detetct post request phpget method type phpphp get server request methodphp get method typephp check for http methodphp check methodphp check method typephp check request methodphp how to check request type post or getdetect whre came the post request phpphp request typemethod type in phpphp get request method php request method checkphp get request methodphp get what user type in http requesthow to check http method in phpphp how to check request methodif request method 3d 3d 27post 27 phpphp if get requesthow to check request method to php scriptphp requested methodphp check if request is gethow to check from where the request is coming phpphp http requestcheck request method phpdetect who came the post request phpdetect from came the post request phpknow http method phpphp switch request methodhow check request in phpin php if method is postphp detect post or get request htaccessif 27post 27 in request method 3ahow to determine request method in phpphp check http request methodcheck accept and method for api request phpphp get used methodchecking request type in php 24 server request method in php for get and postphp get http methodphp type of requesthow to check for a get request phpcheck the request method in phpphp requestrequest method post phpif request method 3dpost phpcheck for http phpcheck get request phphttp method phprequest method is post phpphp check method of http requestif method 3d postcheck request method in phpif method is post phpif request method post phpcheck post request typehow to tell if a request is a put request phpphp request http protocolhow to check the http method in phpif method is postphp request a typehtpp method phpphp determine request methodhow to detect a post requestcheck http method phpphp how do i know which request methodphp post request method chacke codephp if request is truerequest type in phpphp check method of http request