Skip to content

Commit 1b362df

Browse files
authored
Merge pull request #3 from Metify-io/files
Add support for POSTing files and data directly
2 parents 3f8dda0 + 4b6ffc3 commit 1b362df

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ lint:
2020
pipenv run ruff redfish_client
2121

2222
publish:
23-
rm -f dist/*
23+
rm -rf dist/*
2424

2525
pipenv --rm
2626
rm Pipfile.lock
2727
pipenv --python 3.11
2828
pipenv install --dev
2929
pipenv run python setup.py sdist bdist_wheel
30-
3130
pipenv run python -m twine upload -r metify-internal dist/*

redfish_client/connector.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,13 @@ def _log_response(self, method, path, response, json_data):
8585
except Exception as e:
8686
logger.error(e)
8787

88-
def _request(self, method, path, payload=None, headers=None):
88+
def _request(self, method, path, payload=None, headers=None, data=None, files=None):
8989
self._log_request(method, path, payload, headers)
9090
args = dict(json=payload) if payload is not None else {}
91+
if data is not None:
92+
args["data"] = data
93+
if files is not None:
94+
args["files"] = files
9195
try:
9296
resp = self._client.request(
9397
method,

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description = Redfish API client for Python
1010
long_description = file: README.rst
1111
long_description_content_type = text/x-rst
1212
license_file = LICENSE
13-
version = 0.3.12
13+
version = 0.3.13
1414
classifier =
1515
Development Status :: 3 - Alpha
1616
Environment :: Console

0 commit comments

Comments
 (0)