StringContent Constructors
Definition
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.
Overloads
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. |
StringContent(String)
- 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
StringContent(String, MediaTypeHeaderValue)
- 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
StringContent(String, Encoding)
- 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
StringContent(String, Encoding, MediaTypeHeaderValue)
- 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
StringContent(String, Encoding, String)
- 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.