Skip to content

Commit

Permalink
renamed head with headers
Browse files Browse the repository at this point in the history
  • Loading branch information
krishnaglodha committed Nov 18, 2024
1 parent cc43003 commit 960cd8b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/geoserverx/_async/gsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class AsyncGeoServerX:
username: str = "admin"
password: str = "geoserver"
url: str = "http://127.0.0.1:8080/geoserver/rest/"
head = {"Content-Type": "application/json"}
headers: dict = {"Content-Type": "application/json"}

def __post_init__(self):
if not self.username and not self.password and not self.url:
Expand Down Expand Up @@ -153,7 +153,7 @@ async def create_workspace(
responses = await Client.post(
f"workspaces?default={default}",
data=payload.model_dump_json(),
headers=self.head,
headers=self.headers,
)
results = self.response_recognise(responses.status_code)
return results
Expand Down Expand Up @@ -250,7 +250,7 @@ async def create_pg_store(
responses = await Client.post(
f"workspaces/{workspace}/datastores/",
data=payload.model_dump_json(),
headers=self.head,
headers=self.headers,
)
results = self.response_recognise(responses.status_code)
return results
Expand Down Expand Up @@ -387,7 +387,7 @@ async def create_geofence(self, rule: Rule) -> GSResponse:
responses = await Client.post(
"geofence/rules",
content=PostingRule.model_dump_json(),
headers=self.head,
headers=self.headers,
)
results = self.response_recognise(responses.status_code)
return results
20 changes: 10 additions & 10 deletions src/geoserverx/_sync/gsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class SyncGeoServerX:
username: str = "admin"
password: str = "geoserver"
url: str = "http://127.0.0.1:8080/geoserver/rest/"
head = {"Content-Type": "application/json"}
headers: dict = {"Content-Type": "application/json"}

def __post_init__(self):
if not self.username and not self.password and not self.url:
Expand Down Expand Up @@ -171,7 +171,7 @@ def create_workspace(
responses = Client.post(
f"workspaces?default={default}",
content=payload.model_dump_json(),
headers=self.head,
headers=self.headers,
)
results = self.response_recognise(responses.status_code)
return results
Expand Down Expand Up @@ -217,7 +217,7 @@ def create_vector_store(self, workspace: str, store: DataStoresModel) -> GSRespo
responses = Client.post(
f"workspaces/{workspace}/datastores",
content=store.model_dump_json(),
headers=self.head,
headers=self.headers,
)
results = self.response_recognise(responses.status_code)
return results
Expand All @@ -243,7 +243,7 @@ def create_raster_store(
responses = Client.post(
f"workspaces/{workspace}/coveragestores",
content=store.model_dump_json(),
headers=self.head,
headers=self.headers,
)
results = self.response_recognise(responses.status_code)
return results
Expand All @@ -256,11 +256,11 @@ def delete_store(
Client = self.http_client
if type == "raster":
responses = Client.delete(
f"/workspaces/{workspace}/coveragestores/{store}", headers=self.head
f"/workspaces/{workspace}/coveragestores/{store}", headers=self.headers
)
elif type == "vector":
responses = Client.delete(
f"/workspaces/{workspace}/datastores/{store}", headers=self.head
f"/workspaces/{workspace}/datastores/{store}", headers=self.headers
)
results = self.response_recognise(responses.status_code)
return results
Expand Down Expand Up @@ -335,7 +335,7 @@ def create_pg_store(
responses = Client.post(
f"workspaces/{workspace}/datastores/",
data=payload.model_dump_json(),
headers=self.head,
headers=self.headers,
)
results = self.response_recognise(responses.status_code)
return results
Expand Down Expand Up @@ -424,7 +424,7 @@ def create_vector_layer(
responses = Client.post(
f"/workspaces/{workspace}/featuretypes",
data=layer.model_dump(by_alias=True, exclude_none=True),
headers=self.head,
headers=self.headers,
)
results = self.response_recognise(responses.status_code)
return results
Expand All @@ -435,7 +435,7 @@ def create_raster_layer(self, workspace: str, layer: CoverageModel) -> GSRespons
responses = Client.post(
f"/workspaces/{workspace}/coverages",
data=layer.model_dump_json(),
headers=self.head,
headers=self.headers,
)
results = self.response_recognise(responses.status_code)
return results
Expand Down Expand Up @@ -514,7 +514,7 @@ def create_geofence(self, rule: Rule) -> GSResponse:
responses = Client.post(
"geofence/rules",
content=PostingRule.model_dump_json(),
headers=self.head,
headers=self.headers,
)
results = self.response_recognise(responses.status_code)
return results

0 comments on commit 960cd8b

Please sign in to comment.