I suggest you ...

Honour q parameter in accept headers

This is a bit of a nitpick tbh.

The API does not honour the q parameter on accept headers. It will incorrectly return return application/orcid+xml when sent Accept headers in the form:

curl -H 'Accept: application/orcid+json, */*;q=0.1' 'http://pub.orcid.org/search/orcid-bio?q=digital-object-ids:10.1087/20120404';

It's fairly easy to get around by ONLY accepting application/orcid+json but some clients (like jQuery ajax) will add the */*;q=0.1 to the accept types by default even when you ask them to accept only a certain mime type.

(at least that's my reading of how accept headers should work http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html - I'm happy to be corrected here)

3 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Tom DemeranvilleTom Demeranville shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
    postponed  ·  ORCID SupportAdminORCID Support (ORCID Support Team, ORCID) responded  · 

    This is a great suggestion and something we’d like to fix, but I’m not sure when we will have the time to get to it. Right now the ORCID team is focused on fixing major bugs and rolling out promised features and we won’t be able to address this suggestion for many months. But we appreciate the feedback and do want to implement your suggestion; I’m marking this idea as postponed until we are able to add it to our development timeline.

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Tom DemeranvilleTom Demeranville commented  ·   ·  Flag as inappropriate

        As a side note on this, returning JSON when asked for application/json would be great!

        For anyone else who's interested, it's the difference between this jQuery code which fails:
        $.getJSON("/pub.orcid.org/search/orcid-bio/",{q:"digital-object-ids:"+doi})

        and this jQuery code which works:
        $.ajax({dataType:'json',
        url:'/pub.orcid.org/search/orcid-bio/',
        data: {q:"digital-object-ids:"+doi},
        accepts: {json:'application/orcid+json'},
        headers: {Accept : "application/orcid+json"}
        })

        note: you must manually set the headers not just the accept type to override the */*;q=0

      Feedback and Knowledge Base