{"action":"created","issue":{"url":"https://api.github.com/repos/smart-on-fhir/client-py/issues/48","repository_url":"https://api.github.com/repos/smart-on-fhir/client-py","labels_url":"https://api.github.com/repos/smart-on-fhir/client-py/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/smart-on-fhir/client-py/issues/48/comments","events_url":"https://api.github.com/repos/smart-on-fhir/client-py/issues/48/events","html_url":"https://github.com/smart-on-fhir/client-py/issues/48","id":303095708,"number":48,"title":"SOLVED: 406 HTTP errors using mismatched `fhirclient` version and FHIR endpoint","user":{"login":"pacharanero","id":2348385,"avatar_url":"https://avatars0.githubusercontent.com/u/2348385?v=4","gravatar_id":"","url":"https://api.github.com/users/pacharanero","html_url":"https://github.com/pacharanero","followers_url":"https://api.github.com/users/pacharanero/followers","following_url":"https://api.github.com/users/pacharanero/following{/other_user}","gists_url":"https://api.github.com/users/pacharanero/gists{/gist_id}","starred_url":"https://api.github.com/users/pacharanero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pacharanero/subscriptions","organizations_url":"https://api.github.com/users/pacharanero/orgs","repos_url":"https://api.github.com/users/pacharanero/repos","events_url":"https://api.github.com/users/pacharanero/events{/privacy}","received_events_url":"https://api.github.com/users/pacharanero/received_events","type":"User","site_admin":false},"labels":[{"id":124995290,"url":"https://api.github.com/repos/smart-on-fhir/client-py/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-07T13:21:24Z","updated_at":"2018-03-07T17:07:02Z","closed_at":"2018-03-07T13:22:36Z","author_association":"NONE","body":"Not really an issue with this code, but just signpost for others having similar troubles:\r\n\r\nWe were attempting to contact the Cerner unauthenticated demo/sandbox FHIR server at https://fhir-open.sandboxcerner.com/dstu2/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca using this fhirclient library. This is a DSTU2 version FHIR server so we should have maded sure we were using the correct version of `fhirclient`,  however we thought we'd try with the `master` branch initially.\r\n\r\nThe Cerner server seems very sensitive to being passed only the _correct_ `'Accept': 'application/json+fhir'` header, and will refuse to interact if the header is `'Accept': 'application/fhir+json'`. \r\n\r\nThe error received is factually accurate but didn't particularly aid us in finding the problem: (included here for Googleability)\r\n```\r\nrequests.exceptions.HTTPError: 406 Client Error: Not Acceptable for url\r\n```\r\nPostman's error when passing similar invalid headers is coming back from the server and is a little more detailed:\r\n```\r\nThe Accept type is invalid. See the documentation on the fhir.cerner.com website for acceptable format values for the resource you are attempting to access.\r\n```\r\n\r\nIt's our own fault for not using the right version of the library, but we wasted a good hour trying to work out what the problem was and then figuring out how to pass a different header using `fhirclient`, when all we _really_ needed to do was:\r\n\r\n```\r\npip install fhirclient==1.0.3\r\n```"},"comment":{"url":"https://api.github.com/repos/smart-on-fhir/client-py/issues/comments/371209284","html_url":"https://github.com/smart-on-fhir/client-py/issues/48#issuecomment-371209284","issue_url":"https://api.github.com/repos/smart-on-fhir/client-py/issues/48","id":371209284,"user":{"login":"p2","id":358485,"avatar_url":"https://avatars0.githubusercontent.com/u/358485?v=4","gravatar_id":"","url":"https://api.github.com/users/p2","html_url":"https://github.com/p2","followers_url":"https://api.github.com/users/p2/followers","following_url":"https://api.github.com/users/p2/following{/other_user}","gists_url":"https://api.github.com/users/p2/gists{/gist_id}","starred_url":"https://api.github.com/users/p2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p2/subscriptions","organizations_url":"https://api.github.com/users/p2/orgs","repos_url":"https://api.github.com/users/p2/repos","events_url":"https://api.github.com/users/p2/events{/privacy}","received_events_url":"https://api.github.com/users/p2/received_events","type":"User","site_admin":false},"created_at":"2018-03-07T17:07:02Z","updated_at":"2018-03-07T17:07:02Z","author_association":"OWNER","body":"Yes – see the version matrix in the README for correct versions. 👍🏼"}}
{"actor":{"display_login":"p2"}}