MediaWiki REL1_33
|
Various HTTP related functions. More...
Static Public Member Functions | |
static | createMultiClient (array $options=[]) |
Get a configured MultiHttpClient. | |
static | get ( $url, array $options=[], $caller=__METHOD__) |
Simple wrapper for Http::request( 'GET' ) | |
static | getProxy () |
Gets the relevant proxy from $wgHTTPProxy. | |
static | isValidURI ( $uri) |
Check that the given URI is a valid one. | |
static | post ( $url, array $options=[], $caller=__METHOD__) |
Simple wrapper for Http::request( 'POST' ) | |
static | request ( $method, $url, array $options=[], $caller=__METHOD__) |
Perform an HTTP request. | |
static | userAgent () |
A standard user-agent we can use for external requests. | |
Static Public Attributes | |
static | $httpEngine = false |
|
static |
Get a configured MultiHttpClient.
array | $options |
Definition at line 176 of file Http.php.
References $options, $wgHTTPConnectTimeout, $wgHTTPProxy, and $wgHTTPTimeout.
|
static |
Simple wrapper for Http::request( 'GET' )
string | $url | |
array | $options | |
string | $caller | The method making this request, for profiling |
Reimplemented in MediaWikiPageNameNormalizerTestMockHttp.
Definition at line 98 of file Http.php.
References $args, $options, and wfWarn().
Referenced by Installer\dirIsExecutable(), BenchHttpHttps\doRequest(), ImportableUploadRevisionImporter\downloadSource(), ImportSiteScripts\execute(), ExternalStoreHttp\fetchFromURL(), PopulateInterwiki\fetchLinks(), ImportSiteScripts\fetchScriptList(), File\getDescriptionText(), ForeignDBFile\getDescriptionText(), ImportImages\getFileCommentFromSourceWiki(), ImportImages\getFileUserFromSourceWiki(), and FindHooks\getHooksFromOnlineDocCategory().
|
static |
Gets the relevant proxy from $wgHTTPProxy.
Definition at line 161 of file Http.php.
References $wgHTTPProxy.
Referenced by MWHttpRequest\proxySetup(), and HttpTest\testGetProxy().
|
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 149 of file Http.php.
Referenced by MWHttpRequest\__construct(), PhpHttpRequest\execute(), UploadFromUrl\fetchFile(), SideBarTest\initMessagesHref(), and HttpTest\testIsValidUri().
|
static |
Simple wrapper for Http::request( 'POST' )
string | $url | |
array | $options | |
string | $caller | The method making this request, for profiling |
Definition at line 121 of file Http.php.
References $options.
Referenced by Pingback\postPingback().
|
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. Possible keys for the array:
|
string | $caller | The method making this request, for profiling |
Definition at line 61 of file Http.php.
References $options, and $req.
Referenced by FileBackendTest\doTestGetFileHttpUrl(), and ImportStreamSource\newFromURL().
|
static |
A standard user-agent we can use for external requests.
Definition at line 129 of file Http.php.
References $wgVersion.
Referenced by MediaWiki\Sparql\SparqlClient\__construct(), ForeignAPIRepo\getUserAgent(), MediaWiki\Sparql\SparqlClientTest\optionsProvider(), MWHttpRequest\prepare(), and SquidPurgeClient\queuePurge().
|
static |
Definition at line 28 of file Http.php.
Referenced by MediaWiki\Http\HttpRequestFactory\create(), MWHttpRequestTester\factory(), MWHttpRequestTestCase\setUp(), and MWHttpRequestTestCase\tearDown().