3 ms·
Hacking itty.py: let's make honoring Accept: easier and get some REST
- cellularmitosis 15y agoAfter reading Steve Klabnik's "Nobody Understands REST or HTTP" ( http://blog.steveklabnik.com/posts/2011-07-03-nobody-understands-rest-or-http http://blog.steveklabnik.com/posts/2011-07-03-nobody-underst... ), I thought it would be helpful if honoring the client's Accept: header in GET requests were easier. Recently I watched Richard Jones' survey of the various Python micro web-frameworks ( http://www.youtube.com/watch?v=AYjPIMe0BhA http://www.youtube.com/watch?v=AYjPIMe0BhA ), and I was really taken by the design of itty.py. I thought it would be great to extend their idea of the @get decorator for use with Accept:. It turned out to be merely a ~50 line change! Fun! Kudos to the developer of itty.py for writing code which is hack friendly.