Skip to content

Invoke-GraphRequest cmdlet to allow direct requests using underlying HttpClient#245

Merged
georgend merged 21 commits intodevfrom
invokeGraphRequest
Jul 15, 2020
Merged

Invoke-GraphRequest cmdlet to allow direct requests using underlying HttpClient#245
georgend merged 21 commits intodevfrom
invokeGraphRequest

Conversation

@georgend
Copy link
Contributor

@georgend georgend commented Jun 2, 2020

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

- 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)
@ddyett ddyett requested a review from zengin June 26, 2020 15:19
{
GraphRequestSession.ContentHeaders.Add(entry.Key, entry.Value);
}
else
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else if

Copy link
Contributor

@zengin zengin left a 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.

Copy link
Contributor

@zengin zengin left a 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.

Copy link
Member

@peombwa peombwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@georgend georgend merged commit 3cb927d into dev Jul 15, 2020
@georgend georgend linked an issue Jul 18, 2020 that may be closed by this pull request
@georgend georgend deleted the invokeGraphRequest branch July 22, 2020 22:58
@peombwa peombwa mentioned this pull request Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants