Skip to main content

Class JsonPostRequest

Compresses a JSON log payload with GZip and uploads it to the PHP backend as a multipart/form-data POST, matching the expected server-side schema.

public sealed class JsonPostRequest : NetworkPostRequest, IRequest

Inheritance​

Implements​

IRequest

Inherited Members​

NetworkPostRequest.HandleRequest()

Remarks​

GZip compression is applied before upload.

Constructors​

JsonPostRequest()​

Initializes a new instance of the JsonPostRequest class with default settings.

public JsonPostRequest()

JsonPostRequest(string, string)​

Initializes a new instance of the JsonPostRequest class with the specified JSON name and content.

public JsonPostRequest(string jsonname, string json)

Parameters​

NameTypeDescription
jsonnamestringThe name of the JSON file.
jsonstringThe raw JSON data.

JsonPostRequest(string, string, string, int, int)​

Initializes a new instance of the JsonPostRequest class with custom server settings and JSON data.

public JsonPostRequest(string baseURL, string jsonname, string json, int timeOut = 12, int retryCount = 5)

Parameters​

NameTypeDescription
baseURLstringThe server URL to send the POST request to.
jsonnamestringThe name of the JSON file.
jsonstringThe raw JSON data.
timeOutintThe request timeout duration (in seconds).
retryCountintThe number of retry attempts allowed.

Methods​

CreateMultipartFormData()​

Creates the multipart form data for the POST request, including the JSON file name, compressed JSON content, and map name.

protected override List<IMultipartFormSection> CreateMultipartFormData()

Returns​

List<IMultipartFormSection> — A list of IMultipartFormSection representing the form data.

  • Remarks
  • Constructors
    • JsonPostRequest()
    • JsonPostRequest(string, string)
    • JsonPostRequest(string, string, string, int, int)
  • Methods
    • CreateMultipartFormData()