Open Journal Systems  3.3.0
WebServiceRequest Class Reference

Public Member Functions

 __construct ($url, $params, $method='GET', $useProxy=true)
 
 getAccept ()
 
 getAsync ()
 
 getHeaders ()
 
 getMethod ()
 
getParams ()
 
 getUrl ()
 
 getUseProxySettings ()
 
 hasHeader ($header)
 
 setAccept ($accept)
 
 setAsync ($async)
 
 setHeader ($header, $content)
 
 setMethod ($method)
 
 setParams (&$params)
 
 setUrl ($url)
 
 setUseProxySettings ($useProxySettings)
 

Data Fields

 $_accept
 
 $_async = false
 
 $_headers = array()
 
 $_method
 
 $_params
 
 $_url
 
 $_useProxySettings = true
 

Detailed Description

Represents a web service request.

Definition at line 17 of file WebServiceRequest.inc.php.

Constructor & Destructor Documentation

◆ __construct()

WebServiceRequest::__construct (   $url,
  $params,
  $method = 'GET',
  $useProxy = true 
)

Constructor

Parameters
$urlstring The request URL
$paramsmixed array (key value pairs) or string request parameters
$methodstring GET or POST
$useProxyboolean Whether the proxy settings from config.inc.php should be considered

Definition at line 68 of file WebServiceRequest.inc.php.

Member Function Documentation

◆ getAccept()

WebServiceRequest::getAccept ( )

Get the accept header value

Returns
string

Definition at line 139 of file WebServiceRequest.inc.php.

References $_accept.

◆ getAsync()

WebServiceRequest::getAsync ( )

Whether to make an async request.

Returns
boolean

Definition at line 188 of file WebServiceRequest.inc.php.

References $_async.

◆ getHeaders()

WebServiceRequest::getHeaders ( )

Get additional request headers.

Definition at line 171 of file WebServiceRequest.inc.php.

References $_headers.

◆ getMethod()

WebServiceRequest::getMethod ( )

Get the request method

Returns
string

Definition at line 115 of file WebServiceRequest.inc.php.

References $_method.

◆ getParams()

& WebServiceRequest::getParams ( )

Get the request parameters

Returns
mixed array (key value pairs) or string

Definition at line 99 of file WebServiceRequest.inc.php.

References $_params.

◆ getUrl()

WebServiceRequest::getUrl ( )

Get the web service URL

Returns
string

Definition at line 83 of file WebServiceRequest.inc.php.

References $_url.

◆ getUseProxySettings()

WebServiceRequest::getUseProxySettings ( )

Get whether to consider the proxy settings in config.inc.php.

Returns
boolean

Definition at line 204 of file WebServiceRequest.inc.php.

References $_useProxySettings.

◆ hasHeader()

WebServiceRequest::hasHeader (   $header)

Check whether the given header is present in the request.

The check is case insensitive.

Parameters
$headerstring

Definition at line 160 of file WebServiceRequest.inc.php.

◆ setAccept()

WebServiceRequest::setAccept (   $accept)

Set the accept header value

Parameters
$acceptstring

Definition at line 131 of file WebServiceRequest.inc.php.

◆ setAsync()

WebServiceRequest::setAsync (   $async)

Set whether to make an async request. (POST requests only)

Parameters
$asyncboolean

Definition at line 180 of file WebServiceRequest.inc.php.

◆ setHeader()

WebServiceRequest::setHeader (   $header,
  $content 
)

Set an additional request header.

Parameters
$headerstring
$contentstring

Definition at line 148 of file WebServiceRequest.inc.php.

◆ setMethod()

WebServiceRequest::setMethod (   $method)

Set the request method

Parameters
$methodstring

Definition at line 123 of file WebServiceRequest.inc.php.

◆ setParams()

WebServiceRequest::setParams ( $params)

Set the request parameters

Parameters
$paramsmixed array (key value pairs) or string

Definition at line 107 of file WebServiceRequest.inc.php.

◆ setUrl()

WebServiceRequest::setUrl (   $url)

Set the web service URL

Parameters
$urlstring

Definition at line 91 of file WebServiceRequest.inc.php.

◆ setUseProxySettings()

WebServiceRequest::setUseProxySettings (   $useProxySettings)

Set whether to consider the proxy settings in config.inc.php.

Parameters
$useProxySettingsboolean

Definition at line 196 of file WebServiceRequest.inc.php.

Field Documentation

◆ $_accept

string WebServiceRequest::$_accept

Accept header

Definition at line 40 of file WebServiceRequest.inc.php.

Referenced by getAccept().

◆ $_async

boolean WebServiceRequest::$_async = false

Whether to make an asynchronous request

Definition at line 52 of file WebServiceRequest.inc.php.

Referenced by getAsync().

◆ $_headers

array WebServiceRequest::$_headers = array()

Additional request headers

Definition at line 46 of file WebServiceRequest.inc.php.

Referenced by getHeaders().

◆ $_method

string WebServiceRequest::$_method

HTTP request method

Definition at line 34 of file WebServiceRequest.inc.php.

Referenced by getMethod().

◆ $_params

mixed WebServiceRequest::$_params

array (key value pairs) or string

Definition at line 28 of file WebServiceRequest.inc.php.

Referenced by getParams().

◆ $_url

string WebServiceRequest::$_url

Definition at line 22 of file WebServiceRequest.inc.php.

Referenced by getUrl().

◆ $_useProxySettings

boolean WebServiceRequest::$_useProxySettings = true

Whether to consider the proxy settings in the config.inc.php

Definition at line 58 of file WebServiceRequest.inc.php.

Referenced by getUseProxySettings().


The documentation for this class was generated from the following file: