@@ -29,6 +29,7 @@ def __init__(
29
29
timeout = None , # type: int
30
30
verify = True , # type: bool
31
31
retries = 0 , # type: int
32
+ method = "POST" , # type: str
32
33
** kwargs # type: Any
33
34
):
34
35
"""Initialize the transport with the given request parameters.
@@ -43,6 +44,7 @@ def __init__(
43
44
the server's TLS certificate, or a string, in which case it must be a path
44
45
to a CA bundle to use. (Default: True).
45
46
:param retries: Pre-setup of the requests' Session for performing retries
47
+ :param method: HTTP method used for requests. (Default: POST).
46
48
:param kwargs: Optional arguments that ``request`` takes. These can be seen at the :requests_: source code
47
49
or the official :docs_:
48
50
@@ -56,6 +58,7 @@ def __init__(
56
58
self .use_json = use_json
57
59
self .default_timeout = timeout
58
60
self .verify = verify
61
+ self .method = method
59
62
self .kwargs = kwargs
60
63
61
64
# Creating a session that can later be re-use to configure custom mechanisms
@@ -101,7 +104,7 @@ def execute(self, document, variable_values=None, timeout=None):
101
104
post_args .update (self .kwargs )
102
105
103
106
# Using the created session to perform requests
104
- response = self .session .post ( self .url , ** post_args ) # type: ignore
107
+ response = self .session .request ( self . method , self .url , ** post_args ) # type: ignore
105
108
try :
106
109
result = response .json ()
107
110
if not isinstance (result , dict ):
0 commit comments