Пример #1
0
 public void ResetBoundary(string newBoundary = null)
 {
     if (Value.StartsWith("multipart"))
     {
         _value   = null;
         Boundary = MultiPartBoundary.Generate(newBoundary);
     }
 }
Пример #2
0
        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()
            });
        }