We send data to a web service via POST, PUT, or PATCH. All these web requests carry a payload: one or more items of data. How do we code these web services to accept data?
Many people surely know all this by now. Still, here are some things I’ve recently learned about notifying clients (browsers, API clients) about errors. Delivering errors from route handlers to clients This is remarkably easy, once you figure it out. Just use the http-errors package. (Beware, not the http-error package; it does something different. Call … Read more
Stripe.com’s Stripe Elements is a great way to handle payment card information in a way that slows down cybercreeps. It’s secure because customers only enter card numbers into Stripe-furnished iframes, never into forms on the site taking payments via Stripe. Here is the sequence diagram for how Stripe Elements handles data flow
Software designers sometimes need to present UML sequence diagrams like this one. This kind of thing is absurdly fiddly to draw with most graphics packages. But there’s a language called PlantUML that allows us to write them as text and render them in various software tools, including WordPress with the plugin called PlantUML Renderer. The … Read more
What do you do if you have a bunch of different iframes in your web page posting messages? How do you know which iframe a message came from? Even if the iframe document comes from a different origin? This does the trick