Go to the documentation of this file.
45 public static function request( $method, $url, array $options = [], $caller = __METHOD__ ) {
46 $ret = MediaWikiServices::getInstance()->getHttpRequestFactory()->request(
47 $method, $url, $options, $caller );
48 return is_string( $ret ) ? $ret :
false;
64 public static function get( $url, array $options = [], $caller = __METHOD__ ) {
65 $args = func_get_args();
66 if ( isset(
$args[1] ) && ( is_string(
$args[1] ) || is_numeric(
$args[1] ) ) ) {
69 wfWarn(
"Second parameter should not be a timeout.", 2 );
70 $options = isset(
$args[2] ) && is_array(
$args[2] ) ?
72 $options[
'timeout'] =
$args[1];
88 public static function post( $url, array $options = [], $caller = __METHOD__ ) {
99 return MediaWikiServices::getInstance()->getHttpRequestFactory()->getUserAgent();
150 'userAgent' => self::userAgent(),
152 'logger' => LoggerFactory::getInstance(
'http' )
$wgHTTPConnectTimeout
Timeout for connections done internally (in seconds) Only works for curl.
Class to handle multiple HTTP requests.
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.
int $wgHTTPTimeout
Timeout for HTTP requests done internally, in seconds.
$wgHTTPProxy
Proxy to use for CURL requests.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
static getProxy()
Gets the relevant proxy from $wgHTTPProxy.
static createMultiClient(array $options=[])
Get a configured MultiHttpClient.
static isValidURI( $uri)
Check that the given URI is a valid one.
static isValidURI( $uri)
Check that the given URI is a valid one.
wfWarn( $msg, $callerOffset=1, $level=E_USER_NOTICE)
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
Various HTTP related functions.