Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added glow.net.put & glow.net.del to do PUT & DELETE requests with a …
…couple of tests
- Loading branch information
1 parent
6b35e3d
commit 83fafc0
Showing
5 changed files
with
146 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
if ($_SERVER['REQUEST_METHOD'] == 'DELETE') { | ||
echo 'DELETE request'; | ||
} | ||
else { | ||
echo 'NOT a delete request'; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
if ($_SERVER['REQUEST_METHOD'] == 'PUT') { | ||
// since PHP doesn't have a $_PUT global variable, | ||
// we need to get the body this way | ||
parse_str(file_get_contents('php://input'), $put_vars); | ||
// from a purist point of view, PUT doesn't send a response | ||
// apart from the headers, but this is useful for testing | ||
// to see whether the body arrived properly | ||
echo 'PUT: ' . $put_vars['some']; | ||
} | ||
else { | ||
echo 'not a put request'; | ||
} |