Good API practice recommends GET, rather than POST, because a GET URI can be cited and also constructed manually. At the same time, a long GET URI looks messy, and ours are getting long if we use them to preserve the checkbox state. Should we favor GET or POST?
Notes:
Query strings have a browser-determined length limit, which seems to be quite long in all major browsers, so perhaps not a real problem.
A POST request may include a query string, but how to construct one in an HTML form is not clear, since the @method attribute values of GET and POST seem also to control whether there is or is not a query string.
As an alternative to preserving the checkbox state with URL information we could use local or session storage. See https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API. Is web storage a better idea anyway because it requires less client-server traffic?
Good API practice recommends GET, rather than POST, because a GET URI can be cited and also constructed manually. At the same time, a long GET URI looks messy, and ours are getting long if we use them to preserve the checkbox state. Should we favor GET or POST?
Notes:
@method
attribute values ofGET
andPOST
seem also to control whether there is or is not a query string.