/// <summary> /// Adds headers to the response using anonymous types /// </summary> /// <param name="response">Response object</param> /// <param name="headers"> /// Array of headers - each header should be an anonymous type with two string properties /// 'Header' and 'Value' to represent the header name and its value. /// </param> /// <returns>Modified response</returns> public static Response WithHeaders(this Response response, params object[] headers) { return(response.WithHeaders(headers.Select(GetTuple).ToArray())); }
/// <summary> /// Add a header to the response /// </summary> /// <param name="response">Response object</param> /// <param name="header">Header name</param> /// <param name="value">Header value</param> /// <returns>Modified response</returns> public static Response WithHeader(this Response response, string header, string value) { return(response.WithHeaders(new { Header = header, Value = value })); }