Back to FabImage Library website
You are here: Start » Function Reference » HTTP » Http_SendRequest_POST_JSON

Http_SendRequest_POST_JSON
Header: | FIL.h |
---|---|
Namespace: | fil |
Sends a POST request in JSON format to the server and receives answer.
Syntax
C++
C#
void fil::Http_SendRequest_POST_JSON ( const ftl::String& inUrl, const ftl::String& inJsonData, ftl::Conditional<ftl::String>& outAnswer, int& outResponseCode )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
![]() |
inUrl | const String& | Url of request. | |
![]() |
inJsonData | const String& | Request JSON to send. | |
![]() |
outAnswer | Conditional<String>& | Answer text if provided in UTF-8 encoding. | |
![]() |
outResponseCode | int& | Answer code. Typically 200 for OK. |
Description
Filter sends a POST request to the server using application/json format. Filter waits for the text sever answer.
Examples
Filter executed with parameters:
- inUrl = http://localhost/test
- inJsonData = "{'value': 5}"
Request sent to the server:
POST /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}
See Also
- Http_SendRequest_POST_Raw – Sends a POST request to the server and receives an answer.