You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would you consider accepting a callback for the header in the $.request API? If you promises? The example below would be ideal. The callback would allow me to return the request object for more manipulations without having to make the entire method async. It really only needs to be async when the call chain gets to some method that will make the request, like .json() or .text() which is when callbacks, like the one below, can get resolved.
exportfunctionmyApiRequest(path: string){return$.request(baseUrl+path).header("Authorization",async()=>"Bearer "+awaitgetAccessToken()).// please support [async] callbackheader('Content-Type','application/json')}
It is not just convenience, the access token may have expired by the time the caller actually gets around to making the request. With the callback, getAccessToken can re-new the token without interrupting the work-flow.
The text was updated successfully, but these errors were encountered:
https://github.com/dsherret/dax/tree/6aed9b02ccf4debeeb0581f7f576468721631260?tab=readme-ov-file#making-requests
Would you consider accepting a callback for the header in the
$.request
API? If you promises? The example below would be ideal. The callback would allow me to return the request object for more manipulations without having to make the entire method async. It really only needs to be async when the call chain gets to some method that will make the request, like.json()
or.text()
which is when callbacks, like the one below, can get resolved.It is not just convenience, the access token may have expired by the time the caller actually gets around to making the request. With the callback,
getAccessToken
can re-new the token without interrupting the work-flow.The text was updated successfully, but these errors were encountered: