[ 
https://issues.apache.org/jira/browse/SOLR-7405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14497452#comment-14497452
 ] 

Yonik Seeley commented on SOLR-7405:
------------------------------------

bq. ...and it doesn't work. instead of getting a happy status code they get an 
HTTP 415 error and a message about "Missing ContentType"

If they were able to look at an example using curl and translate that into some 
other low-level HTTP lib without any other errors, they are pretty damned good!
And then get get an error message that tells them exactly what's wrong.  Seems 
pretty ideal.  

At the end of the day: they may be "confused" why it worked with curl w/o 
specifying the content-type, but they won't be confused about what they need to 
do to make it work.  That's the important part.

There are a million different things that people can potentially be "confused" 
about - but it really comes down to being practical.   The whole point to 
auto-detecting the content type with curl was to simplify our examples, focus 
on what the example is actually trying to demonstrate, and help make things 
more concise.  We can have a separate web page for making solr work with 
various HTTP libraries... that's not the common case.

Anyway, my original comment on omitting content-type was not a mandate, but a 
"hey, you can do this now if you want".  I certainly intend to omit the content 
type for most JSON examples that I write, as I feel it's the right trade-off 
for what I'm trying to achieve with the docs.  Others can make their own choice.


> Update ref guide curl examples to eliminate Content-Type
> --------------------------------------------------------
>
>                 Key: SOLR-7405
>                 URL: https://issues.apache.org/jira/browse/SOLR-7405
>             Project: Solr
>          Issue Type: Improvement
>          Components: documentation
>            Reporter: Hoss Man
>            Priority: Minor
>
> SOLR-7217 added a special work arround to solr to autodetect the correct 
> content-type if the user-agent indicates curl is in use and the content-type 
> specified is the curl default ("application/x-www-form-urlencoded")
> while this is certianly a nice to have convenience for people who forget to 
> specify a Content-Type when using curl, there was quite a bit of back and 
> forth on the ref guide TODO page about wether all example curl calls in the 
> ref guide should explicitly take advantage of this for brevity.
> I'm opening this issue in the interest of having a more structured place for 
> this discussion.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to