File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1111def _execute_monkey_patch (self ) -> Dict [str , Any ]:
1212 """Temporary method to enable syncronous client code."""
1313 method : str = self .http_method .lower ()
14+ additional_kwargs : Dict [str , Any ] = {}
1415 if method == "get" :
1516 func = requests .get
1617 elif method == "post" :
1718 func = requests .post
19+ # Additionally requires the json body (e.g on insert, self.json==row).
20+ additional_kwargs = {"json" : self .json }
1821 elif method == "put" :
1922 func = requests .put
2023 elif method == "patch" :
2124 func = requests .patch
2225 elif method == "delete" :
2326 func = requests .delete
27+ else :
28+ raise NotImplementedError (f"Method '{ method } ' not recognised." )
2429 url : str = str (self .session .base_url ).rstrip ("/" )
2530 query : str = str (self .session .params )
26- response = func (f"{ url } ?{ query } " , headers = self .session .headers )
31+ response = func (f"{ url } ?{ query } " , headers = self .session .headers , ** additional_kwargs )
2732 return {
2833 "data" : response .json (),
2934 "status_code" : response .status_code ,
You can’t perform that action at this time.
0 commit comments