/**
  * Create a new RequestBody.
  */
 public function __construct()
 {
     $stream = fopen('php://temp', 'w+');
     stream_copy_to_stream(fopen('php://input', 'r'), $stream);
     rewind($stream);
     parent::__construct($stream);
 }
Пример #2
0
 /**
  * Query constructor.
  *
  * @param array|string $bodyData
  */
 public function __construct($bodyData = [])
 {
     if (!is_string($bodyData)) {
         parent::__construct($bodyData);
         return;
     }
     $this->queryString = $bodyData;
 }