Json and XML visitors do not set correct Content-type when path has known extension

When the request path has known extension, content-type is added inside of `$request->setBody()`, because it's called before setting content-type. And the type is inferred from path, which is wrong.

Current tests have empty paths, so they work.