I have installed a Json-Server. Get-Requests to this server are delivering the expected data but now I want to add some search queries to my request. But the result is still the same. I don't know whats my mistake here.
Here is my request: http://localhost:3000/people?age=22
I also tried it with: http://localhost:3000/people?customer.age=22 but the result is still all data.
Thats my JSON-File:
{
"customer": [
{
"id": 1,
"name": "Stefan Winkler",
"phone_number": "017692601589",
"age": "22",
"education": "High School"
},
{
"id": 2,
"name": "Christoph Huber",
"phone_number": "094462649",
"age": "42",
"education": "nothing"
},
{
"id": 3,
"name": "Michael Unholer",
"phone_number": "093862649",
"age": "12",
"education": "Realschule"
}
]
}
try
http://localhost:3000/customer?age=22
[
{
"id": 1,
"name": "Stefan Winkler",
"phone_number": "017692601589",
"age": "22",
"education": "High School"
}
]
http://localhost:3000/customer?name_like=rist
[
{
"id": 2,
"name": "Christoph Huber",
"phone_number": "094462649",
"age": "42",
"education": "nothing"
}
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With