Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating a resource causes: Status: 412 Precondition Failed #37

Open
bktrinadh opened this issue May 5, 2017 · 1 comment
Open

Updating a resource causes: Status: 412 Precondition Failed #37

bktrinadh opened this issue May 5, 2017 · 1 comment

Comments

@bktrinadh
Copy link

Hi,

When I change a FHIR entity and try to update it is causing: Status: 412 Precondition Failed

From the spec for updating a resource we have to set If-Match header whose value I have to pick from meta section in a resource.

The below code snip works that I added in server.py function=put_json()):

        if resource_json.get('id', None) is not None:
            headers['If-Match'] = 'W/"{}"'.format(resource_json.get('meta').get('versionId'))

Thanks
Trinadh..

@p2 p2 added the enhancement label May 8, 2017
@p2
Copy link
Member

p2 commented May 8, 2017

This depends on the server, which is free to require If-Match. Would be nice if the client added this header if a versionId is found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants