made request types const
if the request method is a PUT or POST, set the json content type header and json encode the payload else build an http query
made request types const
if the request method is a PUT or POST, set the json content type header and json encode the payload else build an http query