Core/OfficeDevPnP.Core/Utilities/HttpHelper.cs
/// <summary>
/// This helper method makes an HTTP PATCH request and returns the result as a String
/// </summary>
/// <param name="requestUrl">The URL of the request</param>
/// <param name="accessToken">The OAuth 2.0 Access Token for the request, if authorization is required</param>
/// <param name="content">The content of the request</param>
/// <param name="contentType">The content/type of the request</param>
/// <param name="requestHeaders">A collection of any custom request headers</param>
/// <param name="cookies">Any request cookies values</param>
/// <param name="retryCount">Number of times to retry the request</param>
/// <param name="delay">Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry</param>
/// <param name="userAgent">UserAgent string value to insert for this request. You can define this value in your app's config file using key="SharePointPnPUserAgent" value="PnPRocks"</param>
/// <param name="spContext">An optional SharePoint client context</param>
/// <returns>The String value of the result</returns>
This helper method makes an HTTP PATCH request and returns the result as a String
This helper method makes an HTTP PATCH request and returns the result as a String
public static string MakePatchRequestForString(string requestUrl,
            object content = null,
            string contentType = null,
            string accessToken = null,
            Dictionary<string, string> requestHeaders = null,
            Dictionary<string, string> cookies = null,
            int retryCount = 1,
            int delay = 500,
            string userAgent = null,
            ClientContext spContext = null)
        {
            return (MakeHttpRequest<String>("PATCH",
                requestUrl,
                accessToken: accessToken,
                content: content,
                contentType: contentType,
                resultPredicate: r => r.Content.ReadAsStringAsync().Result,
                requestHeaders: requestHeaders,
                cookies: cookies,
                retryCount: retryCount,
                delay: delay,
                userAgent: userAgent,
                spContext: spContext
            ));
        }
public static string MakePatchRequestForString ( string requestUrl , object content = null , string contentType = null , string accessToken = null , Dictionary < string , string > requestHeaders = null , Dictionary < string , string > cookies = null , int retryCount = 1 , int delay = 500 , string userAgent = null , ClientContext spContext = null ) { return ( MakeHttpRequest < String > ( " " , requestUrl , accessToken : accessToken , content : content , contentType : contentType , resultPredicate : r => r . Content . ReadAsStringAsync ( ) . Result , requestHeaders : requestHeaders , cookies : cookies , retryCount : retryCount , delay : delay , userAgent : userAgent , spContext : spContext ) ) ; }
This helper method makes an HTTP PATCH request and returns the result as a String
This helper method makes an HTTP PATCH request and returns the result as a String
The String value of the result
The String value of the result
requestUrl
string
The URL of the request
The URL of the request
content
object
The content of the request
The content of the request
contentType
string
The content/type of the request
The content / type of the request
accessToken
string
The OAuth 2.0 Access Token for the request, if authorization is required
The OAuth 2 . 0 Access Token for the request if authorization is required
requestHeaders
Dictionary<string, string>
A collection of any custom request headers
A collection of any custom request headers
cookies
Dictionary<string, string>
Any request cookies values
Any request cookies values
retryCount
int
Number of times to retry the request
Number of times to retry the request
delay
int
Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry
Milliseconds to wait before retrying the request . The delay will be increased ( doubled ) every retry
userAgent
string
UserAgent string value to insert for this request. You can define this value in your app's config file using key="SharePointPnPUserAgent" value="PnPRocks"
UserAgent string value to insert for this request . You can define this value in your app ' s config file using key = " SharePointPnPUserAgent " value = " PnPRocks "
spContext
ClientContext
An optional SharePoint client context
An optional SharePoint client context