How I can call class method via variable name, example:
def http_call(http_method):
url = "https://httpbin.org/get"
response = requests.http_method(url)
return response
http_call("get")
http_call("post")
Thanks beforehand.
How I can call class method via variable name, example:
def http_call(http_method):
url = "https://httpbin.org/get"
response = requests.http_method(url)
return response
http_call("get")
http_call("post")
Thanks beforehand.