public void ResetBoundary(string newBoundary = null) { if (Value.StartsWith("multipart")) { _value = null; Boundary = MultiPartBoundary.Generate(newBoundary); } }
public static ContentType MultipartContent(Multipart multipart = default, string boundary = null) { if (string.IsNullOrWhiteSpace(boundary)) { boundary = MultiPartBoundary.Generate(); } return(new ContentType($"multipart/{multipart.ToString().ToLower()}", false, "") { Boundary = boundary.Substring(0, 70).TrimEnd() }); }