title: Requesting JSON file with `Accept: application/json` giving `resource cannot be displayed` error
body: <p>I'm trying to fetch a JSON file from a well-known endpoint (<a href="https://json.schemastore.org" rel="nofollow noreferrer">json.schemastore.org</a>) using <a href="https://www.npmjs.com/package/@actions/http-client" rel="nofollow noreferrer">@actions/http-client</a>. I'm getting an error with that client, and the same error trying the request with cURL:</p>
  <pre class="lang-sh prettyprint-override"><code>$ curl --header &quot;Accept: application/json&quot; https://json.schemastore.org/eslintrc.json
  The resource cannot be displayed because the file extension is not being accepted by your browser.
  </code></pre>
  <p>Adding a <code>Content-Type</code> header to the request causes it to succeed and return the JSON file, but only if it precedes the <code>Accept</code> header in the list passed to cURL (<code>Accept: application/json;Content-Type: application/json</code> causes the same error mentioned above):</p>
  <pre class="lang-sh prettyprint-override"><code>curl --header &quot;Content-Type: application/json;Accept: application/json&quot; https://json.schemastore.org/eslintrc.json
  </code></pre>
  <p>The request also succeeds if I omit the <code>--header</code> param to cURL:</p>
  <pre class="lang-sh prettyprint-override"><code>curl https://json.schemastore.org/eslintrc.json
  </code></pre>
  <p>With the above (no header parameter), cURL is sending this request:</p>
  <pre class="lang-sh prettyprint-override"><code>GET /eslintrc.json HTTP/1.1
  Host: json.schemastore.org
  User-Agent: curl/7.71.1
  Accept: */*
  </code></pre>
  <p>The response headers received from <code>json.schemastore.org</code> using the above cURL command (no header parameter) are:</p>
  <pre class="lang-sh prettyprint-override"><code>HTTP/1.1 200 OK
  Cache-Control: public,max-age=31536000
  Content-Length: 47049
  Content-Type: application/json; charset=utf-8
  Last-Modified: Fri, 10 Sep 2021 17:59:28 GMT
  Accept-Ranges: bytes
  ETag: &quot;1abc4d996da6d71:0&quot;
  Vary: Accept-Encoding, If-Modified-Since
  Server: Microsoft-IIS/10.0
  Content-Security-Policy: object-src 'none';
  Arr-Disable-Session-Affinity: True
  Access-Control-Allow-Origin: *
  Date: Thu, 30 Sep 2021 02:06:18 GMT
  </code></pre>
  <p>The body of the response is the JSON document.</p>
  <p>Can anyone help me understand why just using an <code>Accept: application/json</code> header on the request doesn't work? There's no body in the request, so it doesn't seem like the <code>Content-Type</code> header should be having any effect? And why would the order of the <code>Content-Type</code> and <code>Accept</code> header, passed as arguments to cURL, make any difference? I'm thinking maybe it's some behavior of IIS that I don't understand.</p>