Class JsonClientPayload
Passed as the document to be uploaded with a JsonClient POST or PUT request to customize the payload data and content-type. This can be used in special situations where a REST API needs to push application/x-www-form-urlencoded data or other formats.
Namespace: Neon.Net
Assembly: Neon.Common.dll
Syntax
public class JsonClientPayload
Constructors
JsonClientPayload(string, byte[])
Constructs an instance from the Content-Type header and byte data to be included with the POST/PUT.
Declaration
public JsonClientPayload(string contentType, byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
string | contentType | The value to be passed as the request's Content-Type header. |
byte[] | bytes | The bytes to be uploaded. |
JsonClientPayload(string, string)
Constructs an instance from the Content-Type header and text to be included with the POST/PUT.
note
The uploaded text will be UTF-8 encoded.
Declaration
public JsonClientPayload(string contentType, string text)
Parameters
Type | Name | Description |
---|---|---|
string | contentType | The value to be passed as the request's Content-Type header. |
string | text | The text payload. |
Properties
ContentBytes
Returns the payload bytes to be included in the POST/PUT request.
Declaration
public byte[] ContentBytes { get; }
Property Value
Type | Description |
---|---|
byte[] |
ContentType
Returns the HTTP Content-Type header to be included in the POST/PUT request.
Declaration
public string ContentType { get; }
Property Value
Type | Description |
---|---|
string |