Class StreamDocument
Used by ModelGen generated service client methods to upload body data from a stream as opposed to serializing a document as JSON for service model methods tagged with BodyStreamAttribute.
StreamDocument instances may be passed as the document
parameter to JsonClient methods which recognizes these documents
as special by uploading the stream data instead of JSON.
note
You may also use special document directly in your code if necessary.
Namespace: Neon.Net
Assembly: Neon.Common.dll
Syntax
public class StreamDocument
Constructors
StreamDocument(Stream)
Default constructor.
Declaration
public StreamDocument(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream whose contents from the current position to the end of the stream will be uploaded as the request body. |
Properties
BufferSize
Specifies the size of the buffer to be used for transmitting the body data. This defaults to 8 GiB.
Declaration
public int BufferSize { get; set; }
Property Value
Type | Description |
---|---|
int |
ContentType
Specifies the Content-Type to be used for the uploaded data. This default to application/octet-stream.
Declaration
public string ContentType { get; set; }
Property Value
Type | Description |
---|---|
string |
Stream
Returns the stream whose contents from the current position to the end of the stream will be uploaded as the request body.
Declaration
public Stream Stream { get; }
Property Value
Type | Description |
---|---|
Stream |