Following the lead of #415 and #429, this PR also switches the context.df.callHttp() on orchestration contexts from using explicit arguments to using one options argument for all parameters, following the lead of popular frameworks like axios
const restartResponse = yield context.df.callHttp(
"POST",
`https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}/providers/Microsoft.Compute/virtualMachines/${vmName}/restart?api-version=${apiVersion}`,
undefined, // no request content
undefined, // no request headers (besides auth which is handled by the token source)
tokenSource
);
Following the lead of #415 and #429, this PR also switches the
context.df.callHttp()
on orchestration contexts from using explicit arguments to using one options argument for all parameters, following the lead of popular frameworks likeaxios
Before (actual sample from our docs here):
After:
Changes that were made in this PR:
uri
tourl
content
tobody
(I'm assuming that's what "request content" meant?)If there are other (breaking) changes we want to make to the
callHttp
API, now is the time to call them out. For example:@azure/functions
's lead and accept anundici
HttpHeaders
type forheaders
parameter instead of an object of strings?asynchronousPatternEnabled
argument? It always felt like a confusing name to me, but this is the same the extension uses.