Should a wrong parameter passed via REST call throw an error? -
i accessing rest calls, when passed wrong parameter request not throw http error. should design changed throw http error or wrong parameter can passed rest call.
example 1:(parameters optional) https://example.com/api/fruits?fruit=apple
give list of apple elements
example 2: https://example.com/api/fruits?abc=asb
give list of fruits
my question related example 2, should example 2 throw error or behaving properly?
it's pretty common ignore parameters aren't expecting. think example 2 behaving should.
i know depending on browser append variable timestamp make sure rest call wouldn't cached. like:
https://example.com/api/fruits?ihateie=2342342342
if you're not explicitly doing parameter can't see harm in allowing it.
Comments
Post a Comment