Send to a URL that responds with JSON (using GET request) and return the resulting array or object.
Usage
// basic usage
$bool = $http->getJSON(string $url);
// usage with all arguments
$bool = $http->getJSON(string $url, bool $assoc = true, mixed $data = [], array $options = []);
Arguments
Name | Type(s) | Description |
---|---|---|
url | string | URL to send request to (including http:// or https://) |
assoc (optional) | bool | Default is to return an array (specified by TRUE). If you want an object instead, specify FALSE. |
data (optional) | mixed | Array of data to send (if not already set before) or raw data to send |
options (optional) | array | Optional options to modify default behavior, see the send() method for details. |
Return value
bool
array
object
False on failure or an array or object on success.
See Also
API reference based on ProcessWire core version 3.0.200