Skip to content

Commit

Permalink
add content type header
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Nov 27, 2023
1 parent ffaeb22 commit deb44a7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mpcontribs-client/mpcontribs/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ def _load(protocol, host, headers_json, project, version):
url = f"{protocol}://{host}"
origin_url = f"{url}/apispec.json"
http_client = RequestsClient()
http_client.session.headers.update(headers)
swagger_spec = Spec.from_dict(spec_dict, origin_url, http_client, bravado_config_dict)
http_client.session.close()
return swagger_spec
Expand Down Expand Up @@ -720,6 +721,7 @@ def _expand_params(protocol, host, version, projects_json):
query["_fields"] = ["columns"]
url = f"{protocol}://{host}"
http_client = RequestsClient()
http_client.session.headers["Content-Type"] = "application/json"
resp = http_client.session.get(f"{url}/projects/", params=query).json()

for proj in resp["data"]:
Expand Down

0 comments on commit deb44a7

Please sign in to comment.