5 ms·
URI Template
- vy8vWJlco 14y agoSlightly related (if you hold your head at the right angle) is the (commercial) platform called NetKernel. It brings URIs into conventional programming scenarios, presenting something like a RESTful programming language. (Whatever that might mean...) I haven't done anything with it, but I find it fascinating just to read the documentation: http://docs.netkernel.org/book/view/book:quickstart/doc:quickstart:title http://docs.netkernel.org/book/view/book:quickstart/doc:quic...
- ubersoldat2k7 14y agoWhy do RFC's have to be so ugly?
- seliopou 14y agoI think this[1] is to blame for it. [1]: http://tools.ietf.org/tools/rfcmarkup/ http://tools.ietf.org/tools/rfcmarkup/
- treerex 14y agoBecause they originate from a time where plain text was what you had, and the format was created to be consistent and easy to format by hand. I still prefer my specifications to be in plain text so that I can view them easily and quickly.
- nfoz 14y agoI still prefer my everything in plaintext....
- jrochkind1 14y agoIt would be easy enough to at least format them in HTML, they use such consistent ascii 'typesetting', it could easily be automated. I mean, they are formatted in HTML now, but as a giant block of monospace text. They could use <hx>s for the headers, let the text flow with browser resize for small screens, heck use bootstrap for good readable web typesetting, etc. I am not sure why the IETF isn't interested in better web typesetting for em. At one point someone had a site that did that, I think it was advertised and discussed here on HN, but I forget what it was called, and I think it faded into non-supported obscurity (since it was obviously a labor of love, unpaid).
- twsted 14y agoI really love them. This probably reveals my age...
- icebraining 14y agoNope, I'm <25 and I love them too.
- byroot 14y agoIt's just a formating issue. Nothing prevent you to reformat them: http://pretty-rfc.herokuapp.com/RFC2616 http://pretty-rfc.herokuapp.com/RFC2616
- r00fus 14y agoThis is very cool. Why is the RFC source not available and what does it take to get it?
- byroot 14y agoThe home page states: Note: most RFCs can't be prettified at the moment, as their source files are unavailable to the public and need to be requested from rfc-editor.org. I'm working on this. I suppose that it's just a matter of time.
- zacharyvoase 14y agoI wonder if it'd be worth implementing this in my URLObject library (https://github.com/zacharyvoase/urlobject https://github.com/zacharyvoase/urlobject).
- alanho 14y agoRuby Gems for this https://github.com/sporkmonger/addressable https://github.com/sporkmonger/addressable
- zimbatm 14y agoFor rubyists, the addressable gem has support for it: https://github.com/sporkmonger/addressable/tree/#uri-templates https://github.com/sporkmonger/addressable/tree/#uri-templat...
- soheilpro 14y agoAnd for Node.js: https://github.com/bramstein/url-template https://github.com/bramstein/url-template
- steveklabnik 14y agoGitHub uses URI templates extensively: https://api.github.com/ https://api.github.com/
- nicwolff 14y agoThere's a mature Perl module for this as well: http://search.cpan.org/~bricas/URI-Template-0.17/lib/URI/Template.pm http://search.cpan.org/~bricas/URI-Template-0.17/lib/URI/Tem...
- buro9 14y agoThis is one of two proposed standards I've been following with some interest, the other being a sane(ish) way to implement PATCH for JSON objects: http://tools.ietf.org/html/rfc6902 http://tools.ietf.org/html/rfc6902
- specialist 14y agoVery helpful, thanks for link. I'm working on my own web app "framework" and had rolled my own URL/URI router. This will reduce my reinvention quotient.
- spankalee 14y agoIt's pretty great to have a standard for templates to generate URIs, but it's equally important to parse URIs and extract the variables. It looks like this RFC skimps on that part: In Section 1.4: Some URI Templates can be used in reverse for the purpose of variable matching: comparing the template to a fully formed URI in order to extract the variable parts from that URI and assign them to the named variables. Variable matching only works well if the template expressions are delimited by the beginning or end of the URI or by characters that cannot be part of the expansion, such as reserved characters surrounding a simple string expression. In general, regular expression languages are better suited for variable matching. It'd be better IMO to have a stricter definition of parseable templates and include test cases so that implementations that try to validate templates for parseability don't disagree.