Can a http service return HTTP 400 (bad request) if a required parameter is missing? -
can http service homecoming http 400 (bad request) if required parameter missing? when read around seems http 400 should returned on syntax errors in request, can treat missing argument this?
are asking client's point of view or server's point of view? client point of view, server can homecoming error reason whatsoever; it's out of control. server homecoming error 400 in situation tells it's not ever going fulfil request because thinks there's wrong request. solution error 400 reading spec requests server , fixing request in code. if required parameter missing, certainly have read server's spec , prepare code, error 400 (kind of) appropriate.
if write server code, should homecoming error appropriate, keeping in mind error reported intent either client can study problem user, or client can seek prepare problem or handle appropriately, or client may need code changes prepare problem. reporting wrong error codes confuse clients or forcefulness client codes apply hacks when access server, risk these hacks break when server code fixed. said, cannot find error code more right 400 missing required parameter.
http-status-code-400
No comments:
Post a Comment