Re: triggering servlet on GET parameters
Stephen De Gabrielle <[email protected]>
| Newsgroups | gmane.comp.lang.racket.user,gmane.lisp.scheme.plt |
|---|---|
| Message-ID | <CAGHj7-+3L1E9Ezj7E0uA=keJxeB_XrzEsudHpvjUpXU30DxGWg@mail.gmail.com> |
Thank you Jay, Matthew, Jesse & David, I'm still looking at the resources your referred me to - they are much appreciated. On the bright side I have the basic thing working: https://github.com/spdegabrielle/clash/blob/master/main.rkt I'm trying to build a very basic wiki using scribble as the wiki text! (to replace https://github.com/racket/racket/wiki) If you have time or are interested I'd appreciate feedback on my code. Kind regards, Stephen On Tue, Jan 8, 2019 at 4:55 AM Jesse Alama <[email protected]> wrote: > On 7 Jan 2019, at 0:16, Matthew Butterick wrote: > > > Don't know if it would be an instructive example, but the Pollen > > project server [1], though not intended for production use, is a > > self-contained HTTP server that handles dynamic generation of HTML (it > > even works with Scribble files), which sounds similar to what you're > > trying to do. > > > > Jesse Alama's book Server: Racket [2] is an excellent resource. Among > > many other things, I learned that you can invent arbitrary HTTP > > methods beyond GET and POST, thereby avoiding encoding conventions > > like "?action=edit". Instead, you can just have an HTTP method called > > EDIT. > > In Stephen's case, I think the classical HTTP method PUT is a good > match. PUT is intended to mean, roughly (precise definition at [1]): > here, take this request body; *it* will be the content in response > bodies to GET requests for this URL from now on. > > One of my favorite examples of custom (non-canonical) HTTP methods is > for "cancelling" something (an order, an edit, some item of some group). > > CANCEL https://example.com/order/4567 > > I find this method-URL pair more palatable than something like > > POST https://example.com/cancel/order/4567 > > where the action (cancelling) is part of the URL. > > Alas, not all browsers support such HTTP methods (such requests may get > silently converted into POSTs, despite your wishes), so they tend to be > relevant only in scenarios where you're using programmable HTTP clients > (e.g., command line tools such as cURL or Httpie [2], or libraries such > as Greg Hendershott's http [3]). > > Jesse > > [1] https://tools.ietf.org/html/rfc2616#section-9.6 > > [2] https://httpie.org > > [3] https://pkgs.racket-lang.org/package/http > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] For more options, visit https://groups.google.com/d/optout.