alien4u
05/03/2022, 4:00 PMShawn Talbert
05/03/2022, 4:56 PMrequest
would let you specify the HTTP verb, where as get
means HTTP GETalien4u
05/03/2022, 5:06 PMburkybang
05/03/2022, 5:30 PMrequest
would be for using methods such as HEAD, CONNECT, OPTIONS, TRACE, or PATCH
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methodsburkybang
05/03/2022, 5:35 PMif (method === https.Method.GET)
https.get({...});
else if (method === <http://https.Method.POST|https.Method.POST>)
<http://https.post|https.post>({...});
else if (method === https.Method.DELETE)
https.delete({...});
to something like
https.request({method, ...});
battk
05/03/2022, 5:39 PMget: function get(config, headers, httpClient)
{
checkConfig(config);
if (!utilityFunctions.isObject(config))
{
var url = config;
config = {url: url, headers: headers || null};
}
config.method = this.Method.GET;
return this.request(config, httpClient);
}
the get is just a convenience method for a requestburkybang
05/03/2022, 5:53 PM