Re:Checkbox
by eyelidlessness on Saturday April 03, 2021 @08:58PM
(#26686098)
Half-hearted REST/HATEOAS reply: this wouldn’t be a problem if you put it in a query parameter (or the body with an appropriate content type to account for URL length restrictions)
[ Parent
| on HN ]
Re:Checkbox
by chromakode on Saturday April 03, 2021 @11:20PM
(#26686641)
These API URLs are completely static and side effect free. We considered using a POST body, but then would lose CDN caching, which would make a difference at xkcd's scale. We also decided that URL length restrictions would not likely matter for real world morse input.
I hadn't considered using a query parameter -- that's a really interesting idea! That seems like it'd have been a more elegant solution than the special cased padding we ended up with.
Re:Checkbox
by eyelidlessness on Saturday April 03, 2021 @11:29PM
(#26686678)
Especially for static/idem potent resources where URL length isn’t a concern this is exactly the kind of thing query parameters were designed for. If you do revise it to adopt that please credit Roy Fielding :)