PUT

I’ve been programming for fifteen years now, over half my life, and every single day I still learn something new. I think if I ever stopped learning I’d go crazy and drag a typewriter to the nearest big mansion to bed in for the winter.

Anyway, to the point. REST, for all it’s shortcomings (and yes, there are places where RPC still makes more sense), has taken over most APIs and makes for a pretty easy way of consuming services. POST to create, GET on the collection or entity and PUT to patch. PUT. Oh PUT.

I worked on an entity today that includes image data. POST the multipart image data; works fine. PUT the data; nada, nothing.

So, TIL, you can’t PUT multipart data to a HTTP endpoint. Well, technically you can, but only via various hacks. And a lot of tools, such as httpie, will even ignore the request to upload the file (as they should). It’s one of those little tidbits of knowledge I’ll file away for future note.