-
Notifications
You must be signed in to change notification settings - Fork 192
Invoke-GraphRequest cmdlet to allow direct requests using underlying HttpClient #245
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
Conversation
Use Http enum for validation.
src/Authentication/Authentication/Cmdlets/InvokeGraphRequest.cs
Outdated
Show resolved
Hide resolved
src/Authentication/Authentication/Cmdlets/InvokeGraphRequest.cs
Outdated
Show resolved
Hide resolved
src/Authentication/Authentication/Cmdlets/InvokeGraphRequest.cs
Outdated
Show resolved
Hide resolved
src/Authentication/Authentication/Cmdlets/InvokeGraphRequest.cs
Outdated
Show resolved
Hide resolved
src/Authentication/Authentication/Cmdlets/InvokeGraphRequest.cs
Outdated
Show resolved
Hide resolved
src/Authentication/Authentication/Cmdlets/InvokeGraphRequest.cs
Outdated
Show resolved
Hide resolved
src/Authentication/Authentication/Cmdlets/InvokeGraphRequest.cs
Outdated
Show resolved
Hide resolved
- Enable users to download files to current directory either with custom name or inferred name. - Enable users to pass their own headers. - When Errors happen, print out the whole HttpResponse including headers. - Enable -PassThru, -Verbose (with useful messages)
src/Authentication/Authentication/Cmdlets/InvokeGraphRequest.cs
Outdated
Show resolved
Hide resolved
src/Authentication/Authentication/Cmdlets/InvokeGraphRequest.cs
Outdated
Show resolved
Hide resolved
src/Authentication/Authentication/Cmdlets/InvokeGraphRequest.cs
Outdated
Show resolved
Hide resolved
src/Authentication/Authentication/Cmdlets/InvokeGraphRequest.cs
Outdated
Show resolved
Hide resolved
src/Authentication/Authentication/Cmdlets/InvokeGraphRequest.cs
Outdated
Show resolved
Hide resolved
src/Authentication/Authentication/Cmdlets/InvokeGraphRequest.cs
Outdated
Show resolved
Hide resolved
src/Authentication/Authentication/Cmdlets/InvokeGraphRequest.cs
Outdated
Show resolved
Hide resolved
src/Authentication/Authentication/Cmdlets/InvokeGraphRequest.cs
Outdated
Show resolved
Hide resolved
src/Authentication/Authentication/Cmdlets/InvokeGraphRequest.cs
Outdated
Show resolved
Hide resolved
src/Authentication/Authentication/Cmdlets/InvokeGraphRequest.cs
Outdated
Show resolved
Hide resolved
src/Authentication/Authentication/Cmdlets/InvokeGraphRequest.cs
Outdated
Show resolved
Hide resolved
src/Authentication/Authentication/Cmdlets/InvokeGraphRequest.cs
Outdated
Show resolved
Hide resolved
src/Authentication/Authentication/Cmdlets/InvokeGraphRequest.cs
Outdated
Show resolved
Hide resolved
{ | ||
GraphRequestSession.ContentHeaders.Add(entry.Key, entry.Value); | ||
} | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else if
src/Authentication/Authentication/Helpers/HttpMessageFormatter.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider using functionality from standard library whenever possible.
Move strings to resource file.
Perf improvement, check for token length first.
Extra validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me for local changes, please wait for approval from someone who knows the high level functionality better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Adds an Invoke-GraphRequest cmdlet that enables users to make requests using the underlying authenticated HttpClient.
Example
Invoke-GraphRequest -Method GET -Uri https://graph.microsoft.com/beta/me
Invoke-GraphRequest -Method GET -Uri /beta/me
To support non-json responses requires a change in msgraph-sdk-dotnet-core whose compression handler currently doesn't pass along Http Content headers to the next middleware in the pipeline
Address AB#4897