Skip to content
This repository was archived by the owner on Aug 23, 2024. It is now read-only.

Commit 40a4b86

Browse files
authored
Merge pull request #168 from billdodd/fix/issue-167
Update http__modify_resource() to handle empty body
2 parents 0cf53c1 + f22eea5 commit 40a4b86

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

rf_utility.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,10 +452,10 @@ def http__req_common(sut_prop, http_req, resource_uri, rq_headers, rq_body, auth
452452
###############################################################################################
453453
# Name: http__modify_resource()
454454
# Description: issue a request to the server connection/URI which
455-
# modifies a resource (POST, PATCH, PUT)
455+
# modifies a resource (POST, PATCH, PUT, DELETE)
456456
#
457457
# Arguments:
458-
# rq_type: POST, PATCH or PUT
458+
# rq_type: POST, PATCH, PUT or DELETE
459459
# resource_uri: the uri of the redfish resource
460460
# rq_headers: the request headers. If Content-Type is not specified
461461
# then this routine will set it to json before making the request.
@@ -477,7 +477,8 @@ def http__modify_resource(sut_prop, rq_type, resource_uri, rq_headers, rq_body,
477477

478478
# this routine can take a python dictionary as a request body... or json
479479
# make sure the request is json format..
480-
rq_body = json.dumps(rq_body)
480+
if rq_body:
481+
rq_body = json.dumps(rq_body)
481482

482483
# issue the request
483484
return(http__req_common(sut_prop, rq_type, resource_uri, rq_headers, rq_body, auth_on_off ))

0 commit comments

Comments
 (0)