Skip to content

Commit

Permalink
Use PUT
Browse files Browse the repository at this point in the history
  • Loading branch information
webb-ben committed Jan 23, 2025
1 parent 2c75822 commit 06a5faa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pygeoapi/provider/sensorthings.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def update(self, identifier, item):
id = f"'{identifier}'" \
if isinstance(identifier, str) else str(identifier)
LOGGER.debug(f'Updating @iot.id: {id}')
response = self.http.patch(f"{self._url}({id})", json=item)
response = self.http.put(f"{self._url}({id})", json=item)

if response.status_code == 200:
return True
Expand Down
3 changes: 2 additions & 1 deletion tests/test_sensorthings_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ def test_transactions(config, post_body):
datastream = p.get(121)
assert datastream['properties']['name'] == 'Temperature Datastream'

result = p.update(id, {'name': 'Temperature'})
post_body['name'] = 'Temperature'
result = p.update(id, post_body)
assert result is True

datastream = p.get(121)
Expand Down

0 comments on commit 06a5faa

Please sign in to comment.