7 Parse JSON request bodies into `$_POST`.
11 This tiny extension provides a PHP content type handler for JSON to PHP's form data parser.
13 If the `Content-Type` of an incoming request is `application/json` or `text/json`, the JSON contents of the request body will by parsed into `$_POST`.
17 This extension is hosted at [PECL](http://pecl.php.net) and can be installed with [PEAR](http://pear.php.net)'s pecl command:
19 # pecl install json_post
29 * JSON_OBJECT_AS_ARRAY = 1
30 * JSON_BIGINT_AS_STRING = 2
31 * JSON_OBJECT_AS_ARRAY|JSON_BIGINT_AS_STRING = 3
32 * JSON_INVALID_UTF8_IGNORE = 1048576 ; (PHP >= 7.2)
33 * JSON_INVALID_UTF8_SUBSTITUTE = 2097152 ; (PHP >= 7.2)
34 * JSON_THROW_ON_ERROR is ignored
36 json_post.onerror.response = 0
37 : Send a custom HTTP response status on failure, e.g.:
38 ; send `HTTP/1.1 400 Bad Request` on error
39 json_post.onerror.response = 400
41 json_post.onerror.warning = Off
42 : Raise `E_WARNING` on failure decoding JSON when enabled.
44 json_post.onerror.exit = Off
45 : Exit PHP without running the script on decoding failure when enabled.
50 * Ignore JSON_THROW_ON_ERROR in `json_post.flags`.
51 * Add `json_post.onerror.response` INI setting.
52 * Add `json_post.onerror.warning` INI setting.
53 * Add `json_post.onerror.exit` INI setting.