I've remembered why I did this now: this technique gives access to the ContentType within the second case branch. This is similar to the multipart PUT code further down the file. I'm very happy to change it if there is a better way. That way might then be applicable to the PUT code as well.