Discore
Show / Hide Table of Contents

Method SetContent

| Improve this Doc View Source

SetContent(HttpContent?)

Sets the actual attachment content to upload.

Declaration
public AttachmentOptions SetContent(HttpContent? content)
Parameters
Type Name Description
HttpContent content
Returns
Type Description
AttachmentOptions
Remarks

Cannot be set when referencing an existing attachment.

| Improve this Doc View Source

SetContent(Stream, string?)

Sets the actual attachment content to upload.

Declaration
public AttachmentOptions SetContent(Stream content, string? mediaType = null)
Parameters
Type Name Description
Stream content
string mediaType
Returns
Type Description
AttachmentOptions
Remarks

Cannot be set when referencing an existing attachment.

| Improve this Doc View Source

SetContent(ArraySegment<byte>, string?)

Sets the actual attachment content to upload.

Declaration
public AttachmentOptions SetContent(ArraySegment<byte> content, string? mediaType = null)
Parameters
Type Name Description
ArraySegment<byte> content
string mediaType
Returns
Type Description
AttachmentOptions
Remarks

Cannot be set when referencing an existing attachment.

Exceptions
Type Condition
ArgumentException

Thrown if content.Array is null.

| Improve this Doc View Source

SetContent(string, string?, Encoding?)

Sets the actual attachment content to upload.

Declaration
public AttachmentOptions SetContent(string content, string? mediaType = null, Encoding? encoding = null)
Parameters
Type Name Description
string content
string mediaType

Defaults to text/plain.

Encoding encoding

Defaults to UTF8.

Returns
Type Description
AttachmentOptions
Remarks

Cannot be set when referencing an existing attachment.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX