https://laravel-example.0x0f.tech
API example:https://laravel-example.0x0f.tech/api/health_check
Correct reponse
code=200,message=ok
{
"code": 200,
"message": "ok",
"data": {
"health": "good"
}
}
Incorrect response
code!=200,the trace
will display in code 500s and controled by APP_DEBUG
// internal error
{
"code": 500,
"message": "exception message",
"data": null,
"trace": [
]
}
// invalid input
{
"code": 400,
"message": "The s field is required.",
"data": null
}
Always return a correct response, check if the service can respond normally.(Q2)
GET /api/health_check
a response example when throw a exception.(Q3)
GET /api/test_exception
curl --location 'https://laravel-example.0x0f.tech/api/test_exception'
a response while a runtime error occur.(Q3)
GET /api/test_error
curl --location 'https://laravel-example.0x0f.tech/api/test_error'
A get API, response all data that sent by request.(Q5.a)
GET /api/test_get
curl --location 'https://laravel-example.0x0f.tech/api/test_get?aaa=bbb&cc=dd'
A post API, response all data that sent by request.(Q5.b)
POST /api/test_post
curl --location 'https://laravel-example.0x0f.tech/api/test_post' \
--form 'a="b"' \
--form 'c="d"'
check if the brackets are closed.(Q6)
GET /api/check_brackets
Params | Comment |
---|---|
s | A string of brackets, length is less than 10000 |
curl --location --globoff 'https://laravel-example.0x0f.tech/api/check_brackets?s=]'
# false
curl --location --globoff 'https://laravel-example.0x0f.tech/api/check_brackets?s={[]()}'
# true
curl --location --globoff 'https://laravel-example.0x0f.tech/api/check_brackets?s={//}'
# invalid input
username: laravel
password: laravel666
Table | Comment |
---|---|
debug_logs_yyyy_mm_dd | debug log, archived by date(Q3) |
request_logs | request log(Q4) |