[
https://issues.apache.org/jira/browse/SOLR-5272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13777970#comment-13777970
]
Stefan Matheis (steffkes) commented on SOLR-5272:
-------------------------------------------------
David, i guess you're running the provided example configuration, since you
didn't tell otherwise? If so .. have a look at your [solrconfig.xml
L1730-1736|http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/collection1/conf/solrconfig.xml?view=markup#l1729]:
{code:xml}<queryResponseWriter name="json" class="solr.JSONResponseWriter">
<!-- For the purposes of the tutorial, JSON responses are written as
plain text so that they are easy to read in *any* browser.
If you expect a MIME type of "application/json" just remove this override.
-->
<str name="content-type">text/plain; charset=UTF-8</str>
</queryResponseWriter>{code}
That should do the trick?
btw: {{curl -I http://localhost}} does the same as your command, but is a bit
shorter
> Schema REST API not returning correct Content-Type for JSON
> -----------------------------------------------------------
>
> Key: SOLR-5272
> URL: https://issues.apache.org/jira/browse/SOLR-5272
> Project: Solr
> Issue Type: Bug
> Components: Response Writers
> Affects Versions: 4.4
> Reporter: David Arthur
>
> The new Schema REST API is not returning application/json as the Content-Type
> when wt=json (or when wt is omitted).
> Examples:
> $ curl -s -D - http://localhost:8888/solr/collection1/schema/fields -o
> /dev/null
> {code}
> HTTP/1.1 200 OK
> Content-Type: text/plain; charset=UTF-8
> Date: Wed, 25 Sep 2013 17:29:24 GMT
> Accept-Ranges: bytes
> Transfer-Encoding: chunked
> {code}
> $ curl -s -D - http://localhost:8888/solr/collection1/schema/fields?wt=json
> -o /dev/null
> {code}
> HTTP/1.1 200 OK
> Content-Type: text/plain; charset=UTF-8
> Date: Wed, 25 Sep 2013 17:30:59 GMT
> Accept-Ranges: bytes
> Transfer-Encoding: chunked
> {code}
> $ curl -s -D - http://localhost:8888/solr/collection1/schema/fields?wt=xml -o
> /dev/null
> {code}
> HTTP/1.1 200 OK
> Content-Type: application/xml; charset=UTF-8
> Date: Wed, 25 Sep 2013 17:31:13 GMT
> Accept-Ranges: bytes
> Transfer-Encoding: chunked
> {code}
> $ curl -s -D -
> http://localhost:8888/solr/collection1/schema/fields?wt=javabin -o /dev/null
> {code}
> HTTP/1.1 200 OK
> Content-Type: application/octet-stream
> Date: Wed, 25 Sep 2013 17:31:45 GMT
> Accept-Ranges: bytes
> Transfer-Encoding: chunked
> {code}
> This might be more than just a schema REST API problem - perhaps something to
> do with the Restlet/Solr writer bridge? I peeked in the code but saw nothing
> obvious.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]