/// <summary> /// Matches a request by request content. /// </summary> /// <param name="builder">The request matching builder instance.</param> /// <param name="content">The request content.</param> /// <returns>The request matching builder instance.</returns> public static RequestMatching Content(this RequestMatching builder, Stream content) { if (content is null) { throw new ArgumentNullException(nameof(content)); } using var ms = new MemoryStream(); content.CopyTo(ms); return(builder.Content(ms.ToArray())); }
/// <summary> /// Matches a request by request content. /// </summary> /// <param name="builder">The request matching builder instance.</param> /// <param name="content">The request content.</param> /// <returns>The request matching builder instance.</returns> public static RequestMatching Content(this RequestMatching builder, string content) { return(builder.Content(content, ContentMatcher.DefaultEncoding)); }