AddHeader() 공개 메소드

Adds an Header to only this specific request.
Use this if you have an authentication token that times out on a regular basis.
public AddHeader ( string key, object value ) : void
key string
value object
리턴 void
예제 #1
0
        /// <summary>
        /// Marks the tracked links processed.
        /// </summary>
        /// <param name="self">The self.</param>
        /// <param name="clientId">The client identifier.</param>
        /// <param name="processId">The process identifier.</param>
        /// <returns>Task&lt;System.Boolean&gt;.</returns>
        /// <exception cref="HttpRequestException">
        /// Throws an exception if the <see cref="P:System.Net.Http.HttpResponseMessage.IsSuccessStatusCode" /> property for the HTTP response is false.
        /// </exception>
        public async static Task<bool> MarkTrackedLinksProcessedAsync(this WowClient self, string clientId, Guid processId)
        {
            var request = new RestRequest
                {
                    Resource = "client/{clientId}/trackedlinks/markprocessed/{processId}"
                };

            request.AddHeader("api-version", "1");
            request.AddUrlSegment("clientId", clientId);
            request.AddUrlSegment("processId", processId.ToString());

            var result = await self.Client.ExecuteAsync<BasicResult>(request);

            return result.Result;
        }