Skip to content

Adding DELETE capability #309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"request_parameters": {
"method": "DELETE",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer access_token"
}
},
"request_result": {
}
}
3 changes: 3 additions & 0 deletions spark_pipeline_framework/utilities/api_helper/http_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class RequestType(Enum):
POST = "post"
GET = "get"
HEAD = "head"
DELETE = "delete"


class SingleJsonResult(NamedTuple):
Expand Down Expand Up @@ -165,6 +166,8 @@ def get_response(
request_function = session.post
elif self.request_type == RequestType.HEAD:
request_function = session.head
elif self.request_type == RequestType.DELETE:
request_function = session.delete

# remove None arguments
arguments = {k: v for k, v in arguments.items() if v is not None}
Expand Down
Loading