Member group
.ctor
Declaring type: HttpStringContent
Module: System.Web.Http
Assembly: System.Web.dll
Source file: HttpContentTypes.rvn
Overloads / Variants
.ctor
init(text: string, contentType: MediaType) -> void
Source file: HttpContentTypes.rvn
Encodes UTF-8 text with a validated Content-Type.
Parameters
| Name | Type | Description |
|---|---|---|
text |
String | Text to encode into independently owned bytes. |
contentType |
MediaType | Media type with no charset or charset=utf-8; conflicting charsets fault. |
Remarks
Preserves absent charset, as appropriate for application/json. Does not serialize or validate the format.
.ctor
init(text: string, contentType: string) -> void
Source file: HttpContentTypes.rvn
Encodes text as UTF-8 with an explicit outbound Content-Type.
Parameters
| Name | Type | Description |
|---|---|---|
text |
String | Text to encode into independently owned bytes. |
contentType |
String | Media type validated by the transport before sending. |
.ctor
init(text: string) -> void
Source file: HttpContentTypes.rvn
Encodes text as UTF-8 with text/plain; charset=utf-8.
Parameters
| Name | Type | Description |
|---|---|---|
text |
String | Text to encode into independently owned bytes. |