Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

graph_request

Microsoft Graph request


Description

Class representing a request to the Microsoft Graph API. Currently this is used only in building a batch call.

Format

An R6 object of class graph_request.

Methods

  • new(...): Initialize a new request object with the given parameters. See 'Details' below.

  • batchify(): Generate a list object suitable for incorporating into a call to the batch endpoint.

Details

The initialize() method takes the following arguments, representing the components of a HTTPS request:

  • op: The path of the HTTPS URL, eg /me/drives.

  • body: The body of the HTTPS request, if it is a PUT, POST or PATCH.

  • options: A list containing the query parameters for the URL.

  • headers: Any optional HTTP headers for the request.

  • encode: If a request body is present, how it should be encoded when sending it to the endpoint. The default is json, meaning it will be sent as JSON text; an alternative is raw, for binary data.

  • http_verb: One of "GET" (the default), "DELETE", "PUT", "POST", "HEAD", or "PATCH".

This class is currently used only for building batch calls. Future versions of AzureGraph may be refactored to use it in general API calls as well.

See Also

Examples

graph_request$new("me")

# a new email message in Outlook
graph_request$new("me/messages",
    body=list(
        body=list(
            content="Hello from R",
            content_type="text"
        ),
        subject="Hello",
        toRecipients="bob@example.com"
    ),
    http_verb="POST"
)

AzureGraph

Simple Interface to 'Microsoft Graph'

v1.3.0
MIT + file LICENSE
Authors
Hong Ooi [aut, cre], Microsoft [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.