Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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.

return: self
param: string $type

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

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

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.

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