how to detect change in a http request json code example
Example 1: php detect request type
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Boom baby we a POST method
}
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
// We are a GET method
}
Example 2: how to send http post create request using curl command
$ curl --data "param1=value1¶m2=value2" http://locahost:8080/weather