| Server IP : 10.10.92.66 / Your IP : 104.23.197.231 Web Server : Apache/2.4.52 (Ubuntu) System : Linux jurnalpolinema 5.15.0-177-generic #187-Ubuntu SMP Sat Apr 11 22:54:33 UTC 2026 x86_64 User : jurnal ( 1001) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/jurnal/public_html/lib/pkp/classes/webservice/ |
Upload File : |
<?php
/**
* @file classes/webservice/WebServiceRequest.inc.php
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2000-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class WebServiceRequest
* @ingroup webservice
*
* @brief Represents a web service request.
*/
class WebServiceRequest {
/** @var string */
var $_url;
/** @var mixed array (key value pairs) or string */
var $_params;
/** @var string HTTP request method */
var $_method;
/** @var string Accept header */
var $_accept;
/** @var array Additional request headers */
var $_headers = array();
/** @var boolean Whether to make an asynchronous request */
var $_async = false;
/** @var boolean Whether to consider the proxy settings in the config.inc.php */
var $_useProxySettings = true;
/**
* Constructor
*
* @param $url string The request URL
* @param $params mixed array (key value pairs) or string request parameters
* @param $method string GET or POST
* @param $useProxy boolean Whether the proxy settings from config.inc.php should be considered
*/
function __construct($url, $params, $method = 'GET', $useProxy = true) {
$this->_url = $url;
$this->_params = $params;
$this->_method = $method;
$this->_accept = 'text/xml, */*';
$this->_useProxySettings = $useProxy;
}
//
// Getters and Setters
//
/**
* Get the web service URL
* @return string
*/
function getUrl() {
return $this->_url;
}
/**
* Set the web service URL
* @param $url string
*/
function setUrl($url) {
$this->_url = $url;
}
/**
* Get the request parameters
* @return mixed array (key value pairs) or string
*/
function &getParams() {
return $this->_params;
}
/**
* Set the request parameters
* @param $params mixed array (key value pairs) or string
*/
function setParams(&$params) {
$this->_params =& $params;
}
/**
* Get the request method
* @return string
*/
function getMethod() {
return $this->_method;
}
/**
* Set the request method
* @param $method string
*/
function setMethod($method) {
$this->_method = $method;
}
/**
* Set the accept header value
* @param $accept string
*/
function setAccept($accept) {
$this->_accept = $accept;
}
/**
* Get the accept header value
* @return string
*/
function getAccept() {
return $this->_accept;
}
/**
* Set an additional request header.
* @param $header string
* @param $content string
*/
function setHeader($header, $content) {
$this->_headers[$header] = $content;
}
/**
* Check whether the given header is
* present in the request.
*
* The check is case insensitive.
*
* @param $header string
*/
function hasHeader($header) {
$header = strtolower($header);
foreach($this->_headers as $h => $dummy) {
if ($header == strtolower($h)) return true;
}
return false;
}
/**
* Get additional request headers.
*/
function getHeaders() {
return $this->_headers;
}
/**
* Set whether to make an async request.
* (POST requests only)
* @param $async boolean
*/
function setAsync($async) {
$this->_async = (boolean)$async;
}
/**
* Whether to make an async request.
* @return boolean
*/
function getAsync() {
return $this->_async;
}
/**
* Set whether to consider the proxy settings in config.inc.php.
* @param $useProxySettings boolean
*/
function setUseProxySettings($useProxySettings) {
$this->_useProxySettings = $useProxySettings;
}
/**
* Get whether to consider the proxy settings in config.inc.php.
* @return boolean
*/
function getUseProxySettings() {
return $this->_useProxySettings;
}
}