Alright, so this documentation basically shows you how to use ImposterAPI like a pro.
fetch("https://imposterapi-5.onrender.com/data")
.then(res => res.json())
.then(res => console.log(res))
fetch("https://imposterapi-5.onrender.com/api/data/1")
.then(res => res.json())
.then(res => console.log(res))
fetch("https://imposterapi-5.onrender.com?limit=28")
.then(res => res.json())
.then(res => console.log(res))
fetch("https://imposterapi-5.onrender.com?page=2")
.then(res => res.json())
.then(res => console.log(res))
fetch("https://imposterapi-5.onrender.com/api/data/category/dairy_breakfast")
.then(res => res.json())
.then(res => console.log(res))
fetch("https://imposterapi-5.onrender.com/api/data/category/dairy_breakfast/subcategory/bread")
.then(res => res.json())
.then(res => console.log(res))
fetch("https://imposterapi-5.onrender.com/data", {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"id": 777,
"title": "Bonn Bombay Pav (12 slices)",
"unit": "350g (12 pieces)",
"type": "Pav",
"price": 55,
"image": "https://fakeapi.s3.ap-south-1.amazonaws.com/dairy%26breakfast/bread/bonn-bombay-pav.webp",
"description": "Bonn Prime Time Pav buns, the bread that you seek out, the bread that you believe in, the bread that you relate with and take home each day",
"categories": {
"category": "dairy_breakfast",
"sub-category": "bread"
},
"fssaiLicense": "10019064001813",
"countryOfOrigin": "India",
"shelfLife": "6 Days"
})
})
fetch("https://imposterapi-5.onrender.com/api/data/2", {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"categories": {
"category": "atta_rice",
"sub-category": "dal"
},
})
})
fetch("https://imposterapi-5.onrender.com/api/data/2", {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"categories": {
"category": "atta_rice",
"sub-category": "dal"
},
})
})
fetch("https://imposterapi-5.onrender.com/api/data/1", {
method: 'DELETE',
}).then(res => res.json())
.then(res => console.log(res))