Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

A curl wrapper for bbb.

Copyright: 2021 Andrew Lyons <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 157 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

curl:: (7 methods):
  __construct()
  get_content_type()
  set_content_type()
  post()
  head()
  get()
  handle_response()


Class: curl  - X-Ref

A curl wrapper for bbb.

__construct()   X-Ref
Constructor for the class.


get_content_type()   X-Ref
Fetch the content type.


set_content_type(string $type)   X-Ref
Set the desired current content type.

param: string $type
return: self

post($url, $params = '', $options = [])   X-Ref
HTTP POST method

param: string $url
param: array|string $params
param: array $options
return: null|SimpleXMLElement Null on error

head($url, $options = [])   X-Ref
Fetch the specified URL via a HEAD request.

param: string $url
param: array $options

get($url, $params = [], $options = [])   X-Ref
Fetch the specified URL via a GET request.

param: string $url
param: string $params
param: array $options

handle_response($response)   X-Ref
Handle the response.

param: mixed $response
return: null|SimpleXMLElement Null on error