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
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
| Name | Type | Description |
|---|---|---|
jsonname | string | The name of the JSON file. |
json | string | The 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
| Name | Type | Description |
|---|---|---|
baseURL | string | The server URL to send the POST request to. |
jsonname | string | The name of the JSON file. |
json | string | The raw JSON data. |
timeOut | int | The request timeout duration (in seconds). |
retryCount | int | The 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.