StringContent Constructors

Definition

Creates a new instance of the StringContent class.

Overloads

StringContent(String)

Creates a new instance of the StringContent class.

StringContent(String, Encoding)

Creates a new instance of the StringContent class.

StringContent(String, Encoding, String)

Creates a new instance of the StringContent class.

StringContent(String)

Creates a new instance of the StringContent class.

public:
 StringContent(System::String ^ content);
public StringContent (string content);
new System.Net.Http.StringContent : string -> System.Net.Http.StringContent
Public Sub New (content As String)

Parameters

content
String

The content used to initialize the StringContent.

Remarks

The media type for the StringContent created defaults to text/plain.

StringContent(String, Encoding)

Creates a new instance of the StringContent class.

public:
 StringContent(System::String ^ content, System::Text::Encoding ^ encoding);
public StringContent (string content, System.Text.Encoding encoding);
new System.Net.Http.StringContent : string * System.Text.Encoding -> System.Net.Http.StringContent

Parameters

content
String

The content used to initialize the StringContent.

encoding
Encoding

The encoding to use for the content.

Remarks

The media type for the StringContent created defaults to text/plain.

StringContent(String, Encoding, String)

Creates a new instance of the StringContent class.

public:
 StringContent(System::String ^ content, System::Text::Encoding ^ encoding, System::String ^ mediaType);
public StringContent (string content, System.Text.Encoding encoding, string mediaType);
new System.Net.Http.StringContent : string * System.Text.Encoding * string -> System.Net.Http.StringContent

Parameters

content
String

The content used to initialize the StringContent.

encoding
Encoding

The encoding to use for the content.

mediaType
String

The media type to use for the content.

Applies to