Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F56957148
BaseService.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
720 B
Referenced Files
None
Subscribers
None
BaseService.php
View Options
<?php
namespace
Nasqueron\Api\ServersLog
;
use
Exception
;
class
BaseService
{
///
/// Helper methods
///
protected
function
getBodyObject
()
{
$content
=
file_get_contents
(
'php://input'
);
switch
(
$_SERVER
[
"HTTP_CONTENT_TYPE"
])
{
case
"application/json"
:
return
json_decode
(
$content
);
default
:
throw
new
Exception
(
"Unknown content type."
);
}
}
protected
function
sendSuccessResponse
(
$responseBody
=
''
)
{
// HTTP 200 OK
echo
$responseBody
;
}
protected
function
sendInvalidMethodResponse
()
{
header
(
"HTTP/1.0 405 Method Not Allowed"
);
http_response_code
(
405
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Nov 13, 17:19 (1 d, 23 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4257914
Default Alt Text
BaseService.php (720 B)
Attached To
Mode
rAPISRVLOGS Servers log :: Add new entries API
Attached
Detach File
Event Timeline
Log In to Comment