Problem with POST to expressjs with no body and application/json content type
As noted at https://github.com/visionmedia/express/issues/1316 , express considers POST etc requests with a content type of "application/json" but no body to be malformed. This does not apply to "application/xml".
I have fixed this problem in my local version of swagger-ui by simply doing a check prior to sending the ajax request and changing the content type to "application/xml" if the body is empty (towards the end of OperationView.submitOperation).
In #166 I have a patch that sets no content-type at all of there is no body. That might be a more generic solution than setting a magic "application/xml" for empty bodies.
also see #166
Yeah, no content type makes more sense than application/xml, I agree.