/// <summary> /// /// </summary> /// <param name="request"></param> /// <param name="message"></param> public static void WriteRequest(this HttpWebRequest request, ResourceRequest message) { request.Headers["Authorization"] = "WRAP access_token=\"" + message.AccessToken + "\""; }
/// <summary> /// /// </summary> /// <param name="request"></param> /// <param name="message"></param> public static void WriteRequest(this WebRequest request, ResourceRequest message) { var httpRequest = request as HttpWebRequest; if (null == httpRequest) throw new NotSupportedException("Only HttpWebRequests are supported."); httpRequest.WriteRequest(message); }