HEX
Server: Apache
System: Linux 4801f1b1.ptr.provps.com 6.17.8-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov 13 18:02:25 EST 2025 x86_64
User: nassaugo (1004)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //home/nassaugo/www/wp-content/plugins/wp-all-import-pro/src/Http/Request.php
<?php

namespace Wpai\Http;


class Request
{
    private $content;

    public function __construct($content)
    {
        $this->content = $content;
    }

    public function getRawContent()
    {
        return $this->content;
    }

    public function getJsonParams()
    {
        if(!empty($this->content) && $this->content !== "null") {

            $jsonDecodedContent = json_decode($this->content, true);

            if (is_null($jsonDecodedContent)) {
                throw new \Exception('Invalid JSON Provided');
            }

            return $jsonDecodedContent;
        }
    }

    public function get($element, $default = null)
    {
        if(isset($_GET[$element])) {
            return $_GET[$element];
        } else {
            return $default;
        }
    }
}