Open 0xorial opened 6 years ago
I think I made the Ruby impl assume text/plain by default, because then it would default to doing a plain text match on anything that didn't have a content type, and wouldn't blow up if it tried to parse something that it couln't. I'd prefer this to guessing, as it pushes the user in the direction of specifying a Content-Type. I wanted to make life hard for them if they didn't! @uglyog what does the java impl do? I have vague memories of it defaulting to application/json.
JVM version first checks the Content-Type
header, then checks the first few bytes of the body, and then defaults to text/plain
. But that is for matching. The DSLs will add a Content-Type=application/json
if no content type is provided.
If my service does not expect Content-Type header in the request, my test will always fail...is there any way not to add this header automatically?
From specs
Shouldn't specification be specific about that? For example now I assumed "application/json" by default, so my implementation conforms to specs, but it fails some test-cases, because they assume "text/plain" by default.