Skip to content

Commit

Permalink
add content-type header
Browse files Browse the repository at this point in the history
  • Loading branch information
benleb committed Dec 18, 2023
1 parent dcb7846 commit bf32c45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion surepy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@
AUTHORIZATION,
BASE_RESOURCE,
CONNECTION,
CONTENT_TYPE,
CONTENT_TYPE_JSON,
CONTENT_TYPE_TEXT_PLAIN,
CONTROL_RESOURCE,
DEVICE_TAG_RESOURCE,
ETAG,
HOST,
HTTP_HEADER_X_REQUESTED_WITH,
Expand All @@ -44,7 +46,6 @@
REFERER,
SUREPY_USER_AGENT,
USER_AGENT,
DEVICE_TAG_RESOURCE,
)
from .enums import Location, LockState
from .exceptions import SurePetcareAuthenticationError, SurePetcareConnectionError, SurePetcareError
Expand Down Expand Up @@ -143,6 +144,7 @@ def _generate_headers(self) -> dict[str, str]:
return {
HOST: "app.api.surehub.io",
CONNECTION: "keep-alive",
CONTENT_TYPE: CONTENT_TYPE_JSON,
ACCEPT: f"{CONTENT_TYPE_JSON}, {CONTENT_TYPE_TEXT_PLAIN}, */*",
ORIGIN: "https://surepetcare.io",
USER_AGENT: user_agent if user_agent else SUREPY_USER_AGENT,
Expand Down
1 change: 1 addition & 0 deletions surepy/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
ACCEPT_LANGUAGE = "Accept-Language"
AUTHORIZATION = "Authorization"
CONNECTION = "Connection"
CONTENT_TYPE = "Content-Type"
CONTENT_TYPE_JSON = "application/json"
CONTENT_TYPE_TEXT_PLAIN = "text/plain"
ETAG = "Etag"
Expand Down

0 comments on commit bf32c45

Please sign in to comment.