MediaWiki
1.34.0
|
Various HTTP related functions. More...
Static Public Member Functions | |
static | createMultiClient (array $options=[]) |
Get a configured MultiHttpClient. More... | |
static | get ( $url, array $options=[], $caller=__METHOD__) |
Simple wrapper for Http::request( 'GET' ) More... | |
static | getProxy () |
Gets the relevant proxy from $wgHTTPProxy. More... | |
static | isValidURI ( $uri) |
Check that the given URI is a valid one. More... | |
static | post ( $url, array $options=[], $caller=__METHOD__) |
Simple wrapper for Http::request( 'POST' ) More... | |
static | request ( $method, $url, array $options=[], $caller=__METHOD__) |
Perform an HTTP request. More... | |
static | userAgent () |
A standard user-agent we can use for external requests. More... | |
Static Public Attributes | |
static | $httpEngine = null |
|
static |
Get a configured MultiHttpClient.
array | $options |
Definition at line 142 of file Http.php.
References $wgHTTPConnectTimeout, $wgHTTPProxy, $wgHTTPTimeout, and wfDeprecated().
|
static |
Simple wrapper for Http::request( 'GET' )
string | $url | |
array | $options | |
string | $caller | The method making this request, for profiling |
Definition at line 64 of file Http.php.
References $args, request(), and wfWarn().
Referenced by LocalisationUpdate\GitHubFetcher\fetchDirectory(), ImportImages\getFileCommentFromSourceWiki(), ImportImages\getFileUserFromSourceWiki(), TitleBlacklist\getHttp(), BaseBlacklist\getHttpText(), and PageImages\Hooks\LinksUpdateHookHandler\getUrlBlacklist().
|
static |
Gets the relevant proxy from $wgHTTPProxy.
Definition at line 128 of file Http.php.
References $wgHTTPProxy, and wfDeprecated().
|
static |
Check that the given URI is a valid one.
This hardcodes a small set of protocols only, because we want to deterministically reject protocols not supported by all HTTP-transport methods.
"file://" specifically must not be allowed, for security purpose (see https://www.mediawiki.org/wiki/Special:Code/MediaWiki/r67684).
string | $uri | URI to check for validity |
Definition at line 118 of file Http.php.
References MWHttpRequest\isValidURI().
Referenced by MWHttpRequest\__construct(), PhpHttpRequest\execute(), and UploadFromUrl\fetchFile().
|
static |
Simple wrapper for Http::request( 'POST' )
string | $url | |
array | $options | |
string | $caller | The method making this request, for profiling |
Definition at line 88 of file Http.php.
References request().
|
static |
Perform an HTTP request.
string | $method | HTTP method. Usually GET/POST |
string | $url | Full URL to act on. If protocol-relative, will be expanded to an http:// URL |
array | $options | Options to pass to MWHttpRequest object. See HttpRequestFactory::create docs |
string | $caller | The method making this request, for profiling |
|
static |
A standard user-agent we can use for external requests.
Definition at line 98 of file Http.php.
Referenced by MediaWiki\Sparql\SparqlClient\__construct(), ForeignAPIRepo\getUserAgent(), MWHttpRequest\prepare(), and SquidPurgeClient\queuePurge().
|
static |
Definition at line 31 of file Http.php.
Referenced by MediaWiki\Http\HttpRequestFactory\create().