Table of Contents

Class StringContent

Namespace
System.Net.Http
Assembly
System.Net.Http.dll

Provides HTTP content based on a string.

public class StringContent : ByteArrayContent, IDisposable
Inheritance
StringContent
Implements
Inherited Members
Extension Methods

Constructors

StringContent(string)

Creates a new instance of the StringContent class.

public StringContent(string content)

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(string content, Encoding 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.

StringContent(string, Encoding, string)

Creates a new instance of the StringContent class.

public StringContent(string content, Encoding encoding, string mediaType)

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.