Skip to content

Commit

Permalink
Add content type header (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
timvanoostrom authored Jan 18, 2024
1 parent 241c9bc commit e527522
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/zorgned_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ def send_api_request(bsn, operation="", post_message={}):
headers = None
cert = None

headers = {"Token": ZORGNED_API_TOKEN}
headers = {
"Token": ZORGNED_API_TOKEN,
"Content-type": "application/json; charset=utf-8",
}
cert = (SERVER_CLIENT_CERT, SERVER_CLIENT_KEY)

url = f"{ZORGNED_API_URL}{operation}"
Expand All @@ -29,7 +32,7 @@ def send_api_request(bsn, operation="", post_message={}):
timeout=ZORGNED_API_REQUEST_TIMEOUT_SECONDS,
headers=headers,
cert=cert,
json=default_post_params | post_message # Pipe operator merges the 2 dicts
json=default_post_params | post_message, # Pipe operator merges the 2 dicts
)

return res
Expand Down

0 comments on commit e527522

Please sign in to comment.