Skip to main content

AxiosFile Class

Axios.Net › AxiosNet.Models

A file part for multipart bodies.

public sealed class AxiosFile

Inheritance System.Object → AxiosFile

Constructors​

AxiosFile(byte[], string, string) Constructor​

Creates a file part from bytes.

public AxiosFile(byte[] content, string fileName, string? contentType=null);

Parameters​

content System.Byte[]

The file content.

fileName System.String

File name sent with the part.

contentType System.String

Media type of the part.

AxiosFile(Stream, string, string) Constructor​

Creates a file part from a stream.

public AxiosFile(System.IO.Stream content, string fileName, string? contentType=null);

Parameters​

content System.IO.Stream

The file content, read when the request is sent.

fileName System.String

File name sent with the part.

contentType System.String

Media type of the part.

Properties​

AxiosFile.Content Property​

The file content, a byte[] or a System.IO.Stream.

public object Content { get; }

Property Value​

System.Object

AxiosFile.ContentType Property​

Media type of the part, when set.

public string? ContentType { get; }

Property Value​

System.String

AxiosFile.FileName Property​

File name sent with the multipart part.

public string FileName { get; }

Property Value​

System.String