<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Why aren't REST (JSON) responses using Content-Type: application/json? in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-aren-t-rest-json-responses-using-content-type/m-p/1503417#M4796</link>
    <description>&lt;P&gt;&lt;SPAN&gt;we also have the same doubt. please add wfs:outputFormat=application/json?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2024 10:16:36 GMT</pubDate>
    <dc:creator>MuratAkdogan</dc:creator>
    <dc:date>2024-07-10T10:16:36Z</dc:date>
    <item>
      <title>Why aren't REST (JSON) responses using Content-Type: application/json?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-aren-t-rest-json-responses-using-content-type/m-p/159566#M778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Working with the REST API and I noticed that the content-types are not being set correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As an example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;ESRI_Census_USA Sample Service&lt;/STRONG&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer?f=json"&gt;http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer?f=json&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;returns: &lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;Content-Type:text/plain;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there configuration or URL parameter to fix this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 16:18:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-aren-t-rest-json-responses-using-content-type/m-p/159566#M778</guid>
      <dc:creator>EricWilliams</dc:creator>
      <dc:date>2010-07-01T16:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why aren't REST (JSON) responses using Content-Type: application/json?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-aren-t-rest-json-responses-using-content-type/m-p/159567#M779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;REST (JSON) responses are set to 'text/plain' rather than 'application/json' for a couple of reasons.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;a. 'text/plain' is friendlier. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If we used Content-Type = 'application/json', it is not displayed by the browser. The browser forces you to download and save the response, before allowing you to view it. This would not happen if we used 'text/plain'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;b. The ArcGIS Server REST API supports JavaScript callbacks ('callback' parameter) which help us get around the cross domain issues. When JSON is wrapped by a callback, it is no longer JSON in the 'strict' sense.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Therefore we chose to use 'text/plain' rather than 'application/json'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you absolutely want 'application/json' as the content-type, you can use a proxy that overrides the headers for the JSON requests, and make calls to the REST API using your proxy.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jul 2010 07:52:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-aren-t-rest-json-responses-using-content-type/m-p/159567#M779</guid>
      <dc:creator>RahulRavikumar</dc:creator>
      <dc:date>2010-07-05T07:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: Why aren't REST (JSON) responses using Content-Type: application/json?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-aren-t-rest-json-responses-using-content-type/m-p/159568#M780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think after 7 years of suffering with text\plain, Esri could finally accept the standard&amp;nbsp;&lt;A class="link-titled" href="http://stackoverflow.com/questions/477816/what-is-the-correct-json-content-type" title="http://stackoverflow.com/questions/477816/what-is-the-correct-json-content-type"&gt;What is the correct JSON content type? - Stack Overflow&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also when setting the content type in SOE and then calling the request with f=json i always get invalid text\plain instead of my application\json.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So pretty please with sugar on top, fix the bug &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Petr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2017 11:36:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-aren-t-rest-json-responses-using-content-type/m-p/159568#M780</guid>
      <dc:creator>PetrDiviš</dc:creator>
      <dc:date>2017-05-09T11:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Why aren't REST (JSON) responses using Content-Type: application/json?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-aren-t-rest-json-responses-using-content-type/m-p/159569#M781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Old thread, but for anyone else googling this... At 10.6 the default is application/json:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/rest/enterprise-administration/server/serverproperties.htm" title="https://developers.arcgis.com/rest/enterprise-administration/server/serverproperties.htm"&gt;Server Properties—ArcGIS REST API: Administer your server | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tldr:&amp;nbsp; "defaultJsonResponseContentType—At 10.6, the default content-type for JSON and JSON with callback responses has been changed from text/plain to application/json and application/javascript, respectively. "&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2018 21:54:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-aren-t-rest-json-responses-using-content-type/m-p/159569#M781</guid>
      <dc:creator>MarcGraham1</dc:creator>
      <dc:date>2018-06-25T21:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Why aren't REST (JSON) responses using Content-Type: application/json?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-aren-t-rest-json-responses-using-content-type/m-p/159570#M782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Marc,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My ArcGIS server install is 10.6.1 and this change doesn't seem to be working. By default I still get &lt;SPAN&gt;text/plain when requesting a json response&lt;/SPAN&gt;. I tried to add "defaultJsonResponseContentType": "application/json" into my system properties as a long shot but that didn't make a difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there anything else that is needed to get the response in application/json or is this a bug and I should log it with my local distributor?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2019 03:21:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-aren-t-rest-json-responses-using-content-type/m-p/159570#M782</guid>
      <dc:creator>LeonAus</dc:creator>
      <dc:date>2019-10-11T03:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Why aren't REST (JSON) responses using Content-Type: application/json?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-aren-t-rest-json-responses-using-content-type/m-p/159571#M783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;False alarm. The rest directory automatically uses f=pjson as the format which returns text/plain. Changed to f=json returns the application/json needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2019 04:12:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-aren-t-rest-json-responses-using-content-type/m-p/159571#M783</guid>
      <dc:creator>LeonAus</dc:creator>
      <dc:date>2019-10-11T04:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: Why aren't REST (JSON) responses using Content-Type: application/json?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-aren-t-rest-json-responses-using-content-type/m-p/1503417#M4796</link>
      <description>&lt;P&gt;&lt;SPAN&gt;we also have the same doubt. please add wfs:outputFormat=application/json?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 10:16:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-aren-t-rest-json-responses-using-content-type/m-p/1503417#M4796</guid>
      <dc:creator>MuratAkdogan</dc:creator>
      <dc:date>2024-07-10T10:16:36Z</dc:date>
    </item>
  </channel>
</rss>

