StringContent Constructors
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a new instance of the StringContent class.
StringContent(String) |
Creates a new instance of the StringContent class. |
StringContent(String, MediaTypeHeaderValue) |
Creates a new instance of the StringContent class. |
StringContent(String, Encoding) |
Creates a new instance of the StringContent class. |
StringContent(String, Encoding, MediaTypeHeaderValue) |
Creates a new instance of the StringContent class. |
StringContent(String, Encoding, String) |
Creates a new instance of the StringContent class. |
- Source:
- StringContent.cs
- Source:
- StringContent.cs
- Source:
- StringContent.cs
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.
Applies to
.NET 10 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- StringContent.cs
- Source:
- StringContent.cs
- Source:
- StringContent.cs
Creates a new instance of the StringContent class.
public:
StringContent(System::String ^ content, System::Net::Http::Headers::MediaTypeHeaderValue ^ mediaType);
public StringContent(string content, System.Net.Http.Headers.MediaTypeHeaderValue? mediaType);
public StringContent(string content, System.Net.Http.Headers.MediaTypeHeaderValue mediaType);
new System.Net.Http.StringContent : string * System.Net.Http.Headers.MediaTypeHeaderValue -> System.Net.Http.StringContent
Public Sub New (content As String, mediaType As MediaTypeHeaderValue)
Parameters
- content
- String
The content used to initialize the StringContent.
- mediaType
- MediaTypeHeaderValue
The media type to use for the content.
Applies to
.NET 10 and other versions
Product | Versions |
---|---|
.NET | 7, 8, 9, 10 |
- Source:
- StringContent.cs
- Source:
- StringContent.cs
- Source:
- StringContent.cs
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);
public StringContent(string content, System.Text.Encoding? encoding);
new System.Net.Http.StringContent : string * System.Text.Encoding -> System.Net.Http.StringContent
Public Sub New (content As String, encoding As Encoding)
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.
Applies to
.NET 10 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- StringContent.cs
- Source:
- StringContent.cs
- Source:
- StringContent.cs
Creates a new instance of the StringContent class.
public:
StringContent(System::String ^ content, System::Text::Encoding ^ encoding, System::Net::Http::Headers::MediaTypeHeaderValue ^ mediaType);
public StringContent(string content, System.Text.Encoding? encoding, System.Net.Http.Headers.MediaTypeHeaderValue? mediaType);
public StringContent(string content, System.Text.Encoding? encoding, System.Net.Http.Headers.MediaTypeHeaderValue mediaType);
new System.Net.Http.StringContent : string * System.Text.Encoding * System.Net.Http.Headers.MediaTypeHeaderValue -> System.Net.Http.StringContent
Public Sub New (content As String, encoding As Encoding, mediaType As MediaTypeHeaderValue)
Parameters
- content
- String
The content used to initialize the StringContent.
- encoding
- Encoding
The encoding to use for the content.
- mediaType
- MediaTypeHeaderValue
The media type to use for the content.
Applies to
.NET 10 and other versions
Product | Versions |
---|---|
.NET | 7, 8, 9, 10 |
- Source:
- StringContent.cs
- Source:
- StringContent.cs
- Source:
- StringContent.cs
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);
public StringContent(string content, System.Text.Encoding? encoding, 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
Public Sub New (content As String, encoding As Encoding, mediaType As String)
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
.NET 10 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: