I gave a talk today for Py Web SF called "Techniques for Building Third-party RESTful Web Services". Aside from covering a lot of material from the book "RESTful Web Services", I also covered a handful of tips and tricks that I discovered were necessary when creating a third-party RESTful Web Service meant for consumption by Web browsers. Here are the slides in OpenOffice.org format.
I decided to give Ubuntu 20.04 a try on my 2015 15" MacBook Pro. I didn't actually install it; I just live booted from a USB thumb drive which was enough to try out everything I wanted. In summary, it's not perfect, and issues with my camera would prevent me from switching, but given the right hardware, I think it's a really viable option. The first thing I wanted to try was what would happen if I plugged in a non-HiDPI screen given that my laptop has a HiDPI screen. Without sub-pixel scaling, whatever scale rate I picked for one screen would apply to the other. However, once I turned on sub-pixel scaling, I was able to pick different scale rates for the internal and external displays. That looked ok. I tried plugging in and unplugging multiple times, and it didn't crash. I doubt it'd work with my Thunderbolt display at work, but it worked fine for my HDMI displays at home. I even plugged it into my TV, and it stuck to the 100% scaling I picked for the othe
Comments
The answer, I think, is to go down a level and use httplib directly instead of living with urllib2 and its assumption that all 403s and 404s (for example) should have exceptions raised for them. I've been too lazy to do it yet though. :)
Also, rather than have a script tag load content into a div above the script tag, it's possible to replace the script tag with an automatically generated div.
Apparently the Firefox support for XHR across domains I mentioned is actually a standard. See https://developer.mozilla.org/En/HTTP_access_control and I haven't checked to see what other modern browsers do/will support it.
404 Not Found
The server can not find the requested page:
ironorchid.com/jjinux/articles/restful_web_services/slides.odp (port 80)
Please forward this error screen to ironorchid.com's WebMaster.