I have currently a webservice that load an object which looks like /object/load?id=100
, the problem is that my object is really huge and it takes a long time to get the full response of the webservice just to see if the object exists or not.
What is the best pratice here ?
Creating a new webservice /object/exists?id=100
thats only use HTTP status code (200 if object exists, 404 if not) ?
Add parameter to the /object/load
webservice to return only simplified object ?
If you are only interested in existence, or knowing in advance how the API will respond if you do a real GET
request, HTTP actually has a built-in method for that: HEAD
.
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