-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow capture of HTTP response headers after a cmdlet is run #2394
Comments
Hi @joshtransient as we plan around having the requested feature, the ideal work around would be to use |
Hi @joshtransient we have included the response headers inside a hashtable and you can easily access the response header parameter that you need. Please let us know if this works for you. |
#2600 to resolve this issue |
Issue resolved in 2.15.0 |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
Is your feature request related to a problem? Please describe.
Since the guidance from MSFT is to use Graph API whenever possible to talk to SharePoint Online (since those requests are less subject to throttling than REST/CSOM), it would also help if the PowerShell module could either output HTTP headers so I can capture the recently-introducted IETF rate limiting headers.
Describe the solution you'd like
At the very least, I would like to be able to access response headers after calling a Graph API cmdlet. There are some other uses for this, particularly custom handling of HTTP 302s.
Much like PowerShell has the native
-WarningVariable
and-ErrorVariable
arguments, it would be cool to have something like-ResponseHeadersVariable
like the PWSH 7 version ofInvoke-RestMethod
has.In a future state, after RateLimit gets a formally published spec, would really love to see those headers be taken into account for throttling control.
Describe alternatives you've considered
Writing a script that uses a lot of Invoke-WebRequest (for 5.1) or Invoke-RestMethod (for 7).
Additional context
As I understand it, the RateLimit-* headers only show up in the beta endpoints, and the IETF spec is still in draft status, so I know that getting this into the same pipeline that does throttling control for the other cmdlets is wishful thinking at this point. Simply returning the headers doesn't seem outside of the realm of possibility, though.
The text was updated successfully, but these errors were encountered: