1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-23 09:02:41 +00:00
Arsse/lib/REST/Request.php
J. King 9a8def03c2 Fill in more of the REST handler.
Not yet functional.
2017-03-18 22:30:36 -04:00

21 lines
No EOL
637 B
PHP

<?php
declare(strict_types=1);
namespace JKingWeb\NewsSync\REST;
class Request {
public $method;
public $url;
public $type;
public $stream;
function __construct(string $method = null, string $url = null, string $bodyStream = null, string $contentType = null) {
if(is_null($method)) $method = $_SERVER['REQUEST_METHOD'];
if(is_null($url)) $url = $_SERVER['REQUEST_URI'];
if(is_null($bodyStream)) $bodyStream = "php://input";
if(is_null($contentType)) $contentType = $_SERVER['HTTP_CONTENT_TYPE'];
$this->method = method;
$this->url = $url;
$this->stream = $bodyStream;
$this->type = $contentType;
}
}