On this page
DeterminesStatusCode
trait DeterminesStatusCode (View source)
Methods
bool | ok() Determine if the response code was 200 "OK" response. |
|
bool | created() Determine if the response code was 201 "Created" response. |
|
bool | accepted() Determine if the response code was 202 "Accepted" response. |
|
bool | noContent(int $status = 204) Determine if the response code was the given status code and the body has no content. |
|
bool | movedPermanently() Determine if the response code was a 301 "Moved Permanently". |
|
bool | found() Determine if the response code was a 302 "Found" response. |
|
bool | badRequest() Determine if the response was a 400 "Bad Request" response. |
|
bool | unauthorized() Determine if the response was a 401 "Unauthorized" response. |
|
bool | paymentRequired() Determine if the response was a 402 "Payment Required" response. |
|
bool | forbidden() Determine if the response was a 403 "Forbidden" response. |
|
bool | notFound() Determine if the response was a 404 "Not Found" response. |
|
bool | requestTimeout() Determine if the response was a 408 "Request Timeout" response. |
|
bool | conflict() Determine if the response was a 409 "Conflict" response. |
|
bool | unprocessableEntity() Determine if the response was a 422 "Unprocessable Entity" response. |
|
bool | tooManyRequests() Determine if the response was a 429 "Too Many Requests" response. |
Details
bool ok()
Determine if the response code was 200 "OK" response.
bool created()
Determine if the response code was 201 "Created" response.
bool accepted()
Determine if the response code was 202 "Accepted" response.
bool noContent(int $status = 204)
Determine if the response code was the given status code and the body has no content.
bool movedPermanently()
Determine if the response code was a 301 "Moved Permanently".
bool found()
Determine if the response code was a 302 "Found" response.
bool badRequest()
Determine if the response was a 400 "Bad Request" response.
bool unauthorized()
Determine if the response was a 401 "Unauthorized" response.
bool paymentRequired()
Determine if the response was a 402 "Payment Required" response.
bool forbidden()
Determine if the response was a 403 "Forbidden" response.
bool notFound()
Determine if the response was a 404 "Not Found" response.
bool requestTimeout()
Determine if the response was a 408 "Request Timeout" response.
bool conflict()
Determine if the response was a 409 "Conflict" response.
bool unprocessableEntity()
Determine if the response was a 422 "Unprocessable Entity" response.
bool tooManyRequests()
Determine if the response was a 429 "Too Many Requests" response.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/10.x/Illuminate/Http/Client/Concerns/DeterminesStatusCode.html