Refactored library. Added new validation and excpetions. Added JSON input support
This commit is contained in:
@@ -25,13 +25,30 @@
|
||||
*/
|
||||
|
||||
define("EXCEPTION_NOTSUPPORTED_HTTPMETHOD_CODE", 1003);
|
||||
define("EXCEPTION_NOTSUPPORTED_HTTPMETHOD", "HTTP method not supported. Only DELETE, GET, POST, PUT are supported");
|
||||
define("EXCEPTION_NOTSUPPORTED_HTTPMETHOD",
|
||||
"HTTP method not supported. Only DELETE, GET, POST, PUT are supported");
|
||||
|
||||
define("EXCEPTION_CONTENT_TYPE_JSON_ARRAY_CODE", 1004);
|
||||
define("EXCEPTION_CONTENT_TYPE_JSON_ARRAY",
|
||||
"Content Type JSON does not accept array parameters. Parameters should be"
|
||||
." a JSON string");
|
||||
|
||||
define("EXCEPTION_CONTENT_TYPE_NON_ARRAY_CODE", 1005);
|
||||
define("EXCEPTION_CONTENT_TYPE_NON_ARRAY",
|
||||
"Parameters must be an array unless content type is set to JSON");
|
||||
|
||||
define("EXCEPTION_CONTENT_TYPE_JSON_QUERYAUTH_CODE", 1006);
|
||||
define("EXCEPTION_CONTENT_TYPE_JSON_QUERYAUTH",
|
||||
"Query Authentication cannot be used in conjunction with content type JSON");
|
||||
|
||||
define("EXCEPTION_NOTSUPPORTED_CONTENTTYPE_CODE", 415);
|
||||
define("EXCEPTION_NOTSUPPORTED_CONTENTTYPE", "Content Type not supported. Currently only application/x-www-form-urlencoded and multipart/form-data are supported");
|
||||
define("EXCEPTION_NOTSUPPORTED_CONTENTTYPE",
|
||||
"Content Type not supported. Currently only application/x-www-form-urlencoded, "
|
||||
."application/json, and multipart/form-data are supported");
|
||||
|
||||
define("EXCEPTION_GET_INVALID_CONTENTTYPE_CODE", 415);
|
||||
define("EXCEPTION_GET_INVALID_CONTENTTYPE", "A GET request must have a content type of application/x-www-form-urlencoded");
|
||||
define("EXCEPTION_GET_INVALID_CONTENTTYPE", "A GET request must have a content"
|
||||
." type of application/x-www-form-urlencoded or application/json");
|
||||
|
||||
define("EXCEPTION_SYSTEM_ERROR_CODE", 2000);
|
||||
define("EXCEPTION_JSONDECODE_REQUEST", "Can't deserialize the response JSON: %s");
|
||||
|
||||
Reference in New Issue
Block a user