MakeMultipartForm() private static method

Turn the key and value pairs into a multipart form
private static MakeMultipartForm ( Dictionary, values, string boundary ) : string
values Dictionary,
boundary string
return string
Example #1
0
  /// <summary>
  /// Post the data as a multipart form
  /// </summary>
 public static HttpWebResponse MultipartFormDataPost(string postUrl, string userAgent, Dictionary<string, string> values)
 {
     string formDataBoundary = "---------------------------" + WebHelpers.RandomHexDigits(12);
     string contentType = "multipart/form-data; boundary=" + formDataBoundary;
     string formData = WebHelpers.MakeMultipartForm(values, formDataBoundary);
     return WebHelpers.PostForm(postUrl, userAgent, contentType, formData);
 }
 /// <summary>
 /// Post the data as a multipart form
 /// </summary>
 public static HttpWebResponse MultipartFormDataPost(string postUrl, string userAgent, Dictionary<string, string> values, string boundary)
 {
     string formData = WebHelpers.MakeMultipartForm(values, boundary);
     return WebHelpers.PostForm(postUrl, userAgent, "multipart/form-data; boundary=" + boundary, formData);
 }