Methods
findHttpStatus(value, field) → {Object}
- Source:
This method finds HTTP status by specified field
Parameters:
Name | Type | Default | Description |
---|---|---|---|
value |
String/Integer | The HTTP Status value to filter |
|
field |
String |
code
|
Find by "code" or "key" |
Returns:
- Type
- Object
findStatusByCode(statusCode) → {Object}
This method finds HTTP status by code
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Returns:
- Type
- Object
findStatusByKey(statusKey) → {Object}
This method finds HTTP status by key
Parameters:
Name | Type | Description |
---|---|---|
statusKey |
String | The HTTP Status key |
Returns:
- Type
- Object
isAccepted(statusCode) → {Boolean}
- Source:
Validate HTTP Status code 202 type SUCCESS
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 202
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isAlreadyReported(statusCode) → {Boolean}
Validate HTTP Status code 208 type SUCCESS
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 208
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isBadGateway(statusCode) → {Boolean}
Validate HTTP Status code 502 type SERVER ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 502
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isBadRequest(statusCode) → {Boolean}
Validate HTTP Status code 400 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 400
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isClientClosedRequest(statusCode) → {Boolean}
Validate HTTP Status code 499 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 499
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isConflict(statusCode) → {Boolean}
Validate HTTP Status code 409 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 409
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isConnectionClosedWithoutResponse(statusCode) → {Boolean}
Validate HTTP Status code 444 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 444
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isContinue(statusCode) → {Boolean}
Validate HTTP Status code 100 type INFORMATIONAL
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 100
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isCreated(statusCode) → {Boolean}
- Source:
Validate HTTP Status code 201 type SUCCESS
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 201
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isExpectationFailed(statusCode) → {Boolean}
Validate HTTP Status code 417 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 417
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isFailedDependency(statusCode) → {Boolean}
Validate HTTP Status code 424 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 424
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isForbidden(statusCode) → {Boolean}
Validate HTTP Status code 403 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 403
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isFound(statusCode) → {Boolean}
Validate HTTP Status code 302 type REDIRECTION
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 302
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isGatewayTimeout(statusCode) → {Boolean}
Validate HTTP Status code 504 type SERVER ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 504
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isGone(statusCode) → {Boolean}
Validate HTTP Status code 410 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 410
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isHttpVersionNotSupported(statusCode) → {Boolean}
Validate HTTP Status code 505 type SERVER ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 504
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isImTeapot(statusCode) → {Boolean}
Validate HTTP Status code 418 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 418
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isImUsed(statusCode) → {Boolean}
- Source:
Validate HTTP Status code 226 type SUCCESS
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 226
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isInsufficientStorage(statusCode) → {Boolean}
Validate HTTP Status code 507 type SERVER ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 507
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isInternalServerError(statusCode) → {Boolean}
Validate HTTP Status code 500 type SERVER ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 500
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isLengthRequired(statusCode) → {Boolean}
Validate HTTP Status code 411 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 411
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isLocked(statusCode) → {Boolean}
Validate HTTP Status code 423 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 423
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isLoopDetected(statusCode) → {Boolean}
Validate HTTP Status code 508 type SERVER ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 508
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isMethodNotAllowed(statusCode) → {Boolean}
Validate HTTP Status code 405 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 405
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isMisdirectedRequest(statusCode) → {Boolean}
Validate HTTP Status code 421 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 421
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isMovedPermanently(statusCode) → {Boolean}
Validate HTTP Status code 301 type REDIRECTION
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 301
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isMultipleChoices(statusCode) → {Boolean}
Validate HTTP Status code 300 type REDIRECTION
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 300
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isMultiStatus(statusCode) → {Boolean}
Validate HTTP Status code 207 type SUCCESS
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 207
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isNetworkAuthenticationRequired(statusCode) → {Boolean}
Validate HTTP Status code 511 type SERVER ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 511
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isNetworkConnectTimeoutError(statusCode) → {Boolean}
Validate HTTP Status code 599 type SERVER ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 599
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isNoContent(statusCode) → {Boolean}
Validate HTTP Status code 204 type SUCCESS
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 204
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isNonAuthoritativeInformation(statusCode) → {Boolean}
Validate HTTP Status code 203 type SUCCESS
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 203
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isNotAcceptable(statusCode) → {Boolean}
Validate HTTP Status code 406 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 406
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isNotExtended(statusCode) → {Boolean}
Validate HTTP Status code 510 type SERVER ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 510
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isNotFound(statusCode) → {Boolean}
Validate HTTP Status code 404 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 404
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isNotImplemented(statusCode) → {Boolean}
Validate HTTP Status code 501 type SERVER ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 501
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isNotModified(statusCode) → {Boolean}
Validate HTTP Status code 304 type REDIRECTION
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 304
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isOk(statusCode) → {Boolean}
- Source:
Validate HTTP Status code 200 type SUCCESS
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 200
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isPartialContent(statusCode) → {Boolean}
Validate HTTP Status code 206 type SUCCESS
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 206
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isPayloadTooLarge(statusCode) → {Boolean}
Validate HTTP Status code 413 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 413
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isPaymentRequired(statusCode) → {Boolean}
Validate HTTP Status code 402 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 402
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isPermanentRedirect(statusCode) → {Boolean}
Validate HTTP Status code 308 type REDIRECTION
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 308
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isPreconditionFailed(statusCode) → {Boolean}
Validate HTTP Status code 412 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 412
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isPreconditionRequired(statusCode) → {Boolean}
Validate HTTP Status code 428 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 428
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isProcessing(statusCode) → {Boolean}
Validate HTTP Status code 102 type INFORMATIONAL
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 102
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isProxyAuthenticationRequired(statusCode) → {Boolean}
Validate HTTP Status code 407 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 407
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isRequestedRangeNotSatisfiable(statusCode) → {Boolean}
Validate HTTP Status code 416 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 416
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isRequestHeaderFieldsTooLarge(statusCode) → {Boolean}
Validate HTTP Status code 431 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 431
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isRequestTimeout(statusCode) → {Boolean}
Validate HTTP Status code 408 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 408
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isRequestUriTooLong(statusCode) → {Boolean}
Validate HTTP Status code 414 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 414
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isResetContent(statusCode) → {Boolean}
Validate HTTP Status code 205 type SUCCESS
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 205
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isSeeOther(statusCode) → {Boolean}
Validate HTTP Status code 303 type REDIRECTION
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 303
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isServiceUnavailable(statusCode) → {Boolean}
Validate HTTP Status code 503 type SERVER ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 503
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isSwitchingProtocols(statusCode) → {Boolean}
Validate HTTP Status code 101 type INFORMATIONAL
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 101
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isTemporaryRedirect(statusCode) → {Boolean}
Validate HTTP Status code 307 type REDIRECTION
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 307
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isTooManyRequests(statusCode) → {Boolean}
Validate HTTP Status code 429 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 429
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isUnauthorized(statusCode) → {Boolean}
Validate HTTP Status code 401 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 401
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isUnavailableForLegalReasons(statusCode) → {Boolean}
Validate HTTP Status code 451 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 451
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isUnprocessableEntity(statusCode) → {Boolean}
Validate HTTP Status code 422 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 422
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isUnsupportedMediaType(statusCode) → {Boolean}
Validate HTTP Status code 415 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 415
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isUpgradeRequired(statusCode) → {Boolean}
Validate HTTP Status code 426 type CLIENT ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 426
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isUseproxy(statusCode) → {Boolean}
Validate HTTP Status code 305 type REDIRECTION
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 305
- Type
- HTTPStatusError
Returns:
- Type
- Boolean
isVariantAlsoNegotiates(statusCode) → {Boolean}
Validate HTTP Status code 506 type SERVER ERROR
Parameters:
Name | Type | Description |
---|---|---|
statusCode |
Integer | The HTTP Status code |
Throws:
-
When the statusCode is different then 506
- Type
- HTTPStatusError
Returns:
- Type
- Boolean