Create() public static method

Creates a file parameter from an array of bytes.
public static Create ( string name, byte data, string filename ) : FileParameter
name string The parameter name to use in the request.
data byte The data to use as the file's contents.
filename string The filename to use in the request.
return FileParameter
Example #1
0
 /// <summary>
 /// Adds the bytes to the Files collection with the specified file name and content type
 /// </summary>
 /// <param name="name">The parameter name to use in the request</param>
 /// <param name="bytes">The file data</param>
 /// <param name="fileName">The file name to use for the uploaded file</param>
 /// <param name="contentType">The MIME type of the file to upload</param>
 /// <returns>This request</returns>
 public RestRequest AddFile(string name, byte[] bytes, string fileName, string contentType)
 {
     return(AddFile(FileParameter.Create(name, bytes, fileName, contentType)));
 }
Example #2
0
 /// <summary>
 ///     Adds the bytes to the Files collection with the specified file name
 /// </summary>
 /// <param name="name">The parameter name to use in the request</param>
 /// <param name="bytes">The file data</param>
 /// <param name="fileName">The file name to use for the uploaded file</param>
 /// <param name="contentType">The MIME type of the file to upload</param>
 /// <returns>This request</returns>
 public IRestRequest AddFile(string name, byte[] bytes, string fileName, string contentType = null)
 => AddFile(FileParameter.Create(name, bytes, fileName, contentType));