Esempio n. 1
0
 public void ResetBoundary(string newBoundary = null)
 {
     if (Value.StartsWith("multipart"))
     {
         _value   = null;
         Boundary = MultiPartBoundary.Generate(newBoundary);
     }
 }
Esempio n. 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()
            });
        }