Table of Contents

Class ApiRequest

Namespace
PnP.Core.Services
Assembly
PnP.Core.dll

Defines an API request that can be executed

public class ApiRequest
Inheritance
ApiRequest
Inherited Members

Constructors

ApiRequest(ApiRequestType, string)

Creates an API request to execute

public ApiRequest(ApiRequestType type, string request)

Parameters

type ApiRequestType

ApiRequestType of the request

request string

Actual API call to issue

ApiRequest(HttpMethod, ApiRequestType, string, string, Dictionary<string, string>)

Creates an API request to execute

public ApiRequest(HttpMethod httpMethod, ApiRequestType type, string request, string body, Dictionary<string, string> headers = null)

Parameters

httpMethod HttpMethod

Http method to use

type ApiRequestType

ApiRequestType of the request

request string

Actual API call to issue

body string

Optional body of the request

headers Dictionary<string, string>

Optional headers for the request

Properties

Body

The optional payload/body of the API call to execute

public string Body { get; set; }

Property Value

string

Headers

The optional headers of the API call to execute - for example IF-Match for PATCH Request.

public Dictionary<string, string> Headers { get; }

Property Value

Dictionary<string, string>

HttpMethod

The Http method to use

public HttpMethod HttpMethod { get; set; }

Property Value

HttpMethod

Request

The REST/Graph API call to execute

public string Request { get; set; }

Property Value

string

Type

The type of API call to execute

public ApiRequestType Type { get; set; }

Property Value

ApiRequestType