You are here: Start » FIL.NET » Function Reference » System » HTTP » FIL.Http_SendRequest_PATCH_JSON
Sends a PATCH request in JSON format to the server and receives a text answer.
Namespace: | FilNet |
---|---|
Assembly: | FIL.NET.dll |
Syntax
public static void Http_SendRequest_PATCH_JSON ( string inUrl, IList<string> inHeaders, IList<string> inHeadersData, string inJsonData, int inTimeout, bool inAllowUntrusted, INullable<string> outAnswer, out int outResponseCode )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() | inUrl | string | URL of request. | ||
![]() | inHeaders | System.Collections.Generic.IList<string> | Request headers to send. They will be automatically encoded. | ||
![]() | inHeadersData | System.Collections.Generic.IList<string> | Request headers to send. They will be automatically encoded. | ||
![]() | inJsonData | string | Request JSON to send. | ||
![]() | inTimeout | int | <0, INF> | 60 | Request timeout in seconds. Default value: 60. |
![]() | inAllowUntrusted | bool | False | Whether or not to allow untrusted SSL certificates. Default value: False. | |
![]() | outAnswer | FilNet.INullable<string> | Answer text if provided in UTF-8 encoding. This parameter cannot be null. | ||
![]() | outResponseCode | int | Answer code. Typically 200 for OK. |
Description
Filter sends a PATCH request to the server using application/json format. Filter waits for the text server answer.
When inCaCertFile is set to Auto, certificates installed in the operating system are used, otherwise only certificates from the input file are used.
Examples
Filter executed with parameters:
- inUrl = http://localhost/test
- inJsonData = "{'value': 5}"
Request sent to the server:
PATCH /test HTTP/1.1 Host: localhost User-Agent: FabImage/1.0 Accept: application/json Content-Type: application/json charset: utf-8 Content-Length: 12 {'value': 5}
It is also possible to include custom headers in the request. For this purpose, inHeaders and inHeadersData parameters are used.
Using the following values for these parameters:
- inHeaders = ["Header1", "Header2"]
- inHeadersData = ["value1", "value2"]
causes the following headers to be added to the request:
Header1: value1 Header2: value2
Remarks
Filter only accepts text answers encoded using UTF-8 or plain ASCII.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Different size of inHeaders and inHeadersData in Http_SendRequest_PATCH_JSON. |
DomainError | Empty inUrl in Http_SendRequest_PATCH_JSON. |
DomainError | Invalid inUrl in Http_SendRequest_PATCH_JSON. |