本文整理汇总了C#中IO.Swagger.Api.PetApi.UploadFile方法的典型用法代码示例。如果您正苦于以下问题:C# PetApi.UploadFile方法的具体用法?C# PetApi.UploadFile怎么用?C# PetApi.UploadFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IO.Swagger.Api.PetApi
的用法示例。
在下文中一共展示了PetApi.UploadFile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestUploadFile
public void TestUploadFile()
{
PetApi petApi = new PetApi ();
//NOTE: please provide a valid file (full path)
FileStream fileStream = new FileStream("/var/tmp/small.gif", FileMode.Open);
petApi.UploadFile(petId, "new form name", fileStream);
}
示例2: TestUploadFile
public void TestUploadFile()
{
PetApi petApi = new PetApi ();
//NOTE: please provide a valid file (full path)
FileStream fileStream = new FileStream("/var/tmp/small.gif", FileMode.Open);
// test file upload with form parameters
petApi.UploadFile(petId, "new form name", fileStream);
// test file upload without any form parameters
// using optional parameter syntax introduced at .net 4.0
petApi.UploadFile(petId: petId, file: fileStream);
}
示例3: TestUploadFile
public void TestUploadFile()
{
PetApi petApi = new PetApi ();
//NOTE: please provide a valid file (full path)
FileStream fileStream = new FileStream("/var/tmp/small.gif", FileMode.Open);
// test file upload with form parameters
petApi.UploadFile(petId, "new form name", fileStream);
// test file upload without any form parameters
petApi.UploadFile(petId, null, fileStream);
}
示例4: UploadFileTest
public void UploadFileTest()
{
Assembly _assembly = Assembly.GetExecutingAssembly();
Stream _imageStream = _assembly.GetManifestResourceStream("IO.Swagger.Test.swagger-logo.png");
PetApi petApi = new PetApi ();
// test file upload with form parameters
petApi.UploadFile(petId, "new form name", _imageStream);
// test file upload without any form parameters
// using optional parameter syntax introduced at .net 4.0
petApi.UploadFile(petId: petId, file: _imageStream);
}