<PackageReference Include="Azure.Core" Version="1.47.2" />

RequestContent

public abstract class RequestContent : IDisposable
Represents the content sent as part of the Request.
protected RequestContent()

public static RequestContent Create(Stream stream)

Creates an instance of RequestContent that wraps a Stream.

public static RequestContent Create(byte[] bytes)

Creates an instance of RequestContent that wraps an Arrayof Byte.

public static RequestContent Create(byte[] bytes, int index, int length)

Creates an instance of RequestContent that wraps an Arrayof Byte.

public static RequestContent Create(ReadOnlyMemory<byte> bytes)

Creates an instance of RequestContent that wraps a Stream.

public static RequestContent Create(ReadOnlySequence<byte> bytes)

Creates an instance of RequestContent that wraps a ReadOnlySequence<T>.

public static RequestContent Create(string content)

Creates a RequestContent representing the UTF-8 Encoding of the given String/

public static RequestContent Create(BinaryData content)

Creates an instance of RequestContent that wraps a BinaryData.

public static RequestContent Create(DynamicData content)

Creates an instance of RequestContent that wraps a DynamicData.

public static RequestContent Create(object serializable)

Creates an instance of RequestContent that wraps a serialized version of an object.

public static RequestContent Create(object serializable, ObjectSerializer serializer)

Creates an instance of RequestContent that wraps a serialized version of an object.

public static RequestContent Create(object serializable, JsonPropertyNames propertyNameFormat, string dateTimeFormat = "o")

Creates an instance of RequestContent that wraps a serialized version of an object.

public static RequestContent Create<T>(T model, ModelReaderWriterOptions options = null) where T : IPersistableModel<T>

Creates an instance of RequestContent that wraps an IPersistableModel<T>.

public static RequestContent op_Implicit(string content)

Creates a RequestContent representing the UTF-8 Encoding of the given String.

public static RequestContent op_Implicit(BinaryData content)

Creates a RequestContent that wraps a BinaryData.

public static RequestContent op_Implicit(DynamicData content)

Creates a RequestContent that wraps a DynamicData.

public abstract void Dispose()

Frees resources held by the RequestContent object.

public abstract bool TryComputeLength(out long length)

Attempts to compute the length of the underlying content, if available.

public abstract void WriteTo(Stream stream, CancellationToken cancellation)

Writes contents of this object to an instance of Stream.

public abstract Task WriteToAsync(Stream stream, CancellationToken cancellation)

Writes contents of this object to an instance of Stream.