Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.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