Sends an HTTP or HTTPS request to a SharePoint Online REST-compliant web service.

Invoke-SPORestMethod -Url <UrlPipeBind> [-Method [<WebRequestMethod>]] [-Body [<Object>]] [-RequestDigest [<String>]] [-ETag [<String>]] [-XHTTPMethod [<WebRequestMethod>]] [-JSONVerbosity [<String>]] [-OutFile [<String>]]




The REST endpoint URL to call.


Specifies the method used for the web request. The default value is "Get".


Specifies the body of the request. The body is the content of the request that follows the headers. You can also pipe a body value to Invoke-SPORestMethod.


The "X-RequestDigest" header to set. This is most commonly used to provide the form digest variable. Use "(Invoke-SPORestMethod -Url "" -Method "Post").GetContextWebInformation.FormDigestValue" to get the Form Digest value.


The "If-Match" header to set. Provide this to make sure you are not overwritting an item that has changed since you retrieved it.


To work around the fact that many firewalls and other network intermediaries block HTTP verbs other than GET and POST, specify PUT, DELETE, or MERGE requests for -XHTTPMethod with a POST value for -Method.


The OData verbosity of the data to return. Valid values are "Verbose", "MinimalMetadata", and "NoMetadata".


If the returned data is a binary data object such as a file from a SharePoint site specify the output file name to save the data to.

Detailed Description

This function sends an HTTP or HTTPS request to a Representational State Transfer (REST)-compliant ("RESTful") SharePoint Online web service. The Connect-SPOSite cmdlet must be run first in order to set the credentials for the environment.

Some source code for this cmdlet was referenced from

Copyright 2016 Falchion Consulting, LLC

> For more information on this cmdlet and others:


> Use of this cmdlet is at your own risk.

> Gary Lapointe assumes no liability.



PS C:\> Connect-SPOSite -Url "" -Credential ""
PS C:\> Invoke-SPORestMethod ""

This example invokes the REST call at