<p dir="auto">This causes overhead on client side when parsing the errors since need to recheck content type for every error in order not to parse plain text as json (some libraries fail on that).<br>
The errors message format should be standardized.</p>
<p dir="auto">Examples:<br>
404: Page Not Found<br>
Content-Type: text/plain; charset=utf-8</p>
<p dir="auto">405 Method Not Allowed<br>
Content-Type: text/plain</p>
<p dir="auto">409 Conflict<br>
Content-Type: application/json</p>
<p dir="auto">500 Internal Server Error<br>
Content-Type: application/json</p>
<p dir="auto">If go-restful detects a particular method is not allowed, it will return this error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="HTTP/1.1 405 Method Not Allowed
Content-Type: text/plain; charset=utf-8

405: Method Not Allowed"><pre class="notranslate"><code class="notranslate">HTTP/1.1 405 Method Not Allowed
Content-Type: text/plain; charset=utf-8

405: Method Not Allowed
</code></pre></div>
<p dir="auto">That is preventing useful methods that resthandler would generate from making it to the client. Expected response:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="HTTP/1.1 405 Method Not Allowed
Content-Type: application/json

{
  &quot;kind&quot;: &quot;Status&quot;,
  &quot;creationTimestamp&quot;: null,
  &quot;apiVersion&quot;: &quot;v1beta3&quot;,
  &quot;status&quot;: &quot;Failure&quot;,
  &quot;message&quot;: &quot;update is not supported on resources of kind event&quot;,
  &quot;reason&quot;: &quot;InternalError&quot;,
  &quot;details&quot;: {
    &quot;kind&quot;: &quot;event&quot;
  },
  &quot;code&quot;: 405
}"><pre class="notranslate"><code class="notranslate">HTTP/1.1 405 Method Not Allowed
Content-Type: application/json

{
  "kind": "Status",
  "creationTimestamp": null,
  "apiVersion": "v1beta3",
  "status": "Failure",
  "message": "update is not supported on resources of kind event",
  "reason": "InternalError",
  "details": {
    "kind": "event"
  },
  "code": 405
}
</code></pre></div>