callPostMethod

IMPORTANT!  
This function is deprecated. Use httpPost instead.

Runs an HTTP Post request and returns the HTTP response from the server.

Syntax

Copy
function callPostMethod(url : string, postData : any, timeout : number, additionalHeaders : any): IFtosHttpResult;
 
Parameter Type Description
url string The service endpoint's URI. For instance, the address of a REST API endpoint.
postData optional any Key-value pairs in JSON format to be passed in the request's body.
timeout optional number Maximum number of seconds to wait for the HTTP response.
additionalHeaders optional any Key-value pairs in JSON format to be passed in the request's custom headers.

Return Value

Returns the HTTP response in a JSON object.

Copy
{
    isSuccess : boolean;
    message? : string;
    response : any;
    statusCode : number
}

For example:

Copy
{
    "IsSuccess": true,
    "Response": "{\"NumberOfResults\":0,\"TotalNumber\":0,\"RequestedSkip\":0,\"RequestedTake\":0,\"Records\":[{\"previousBSId\":\"d056648b-fb96-4210-b253-6de285f27c48\",\"businessStatusId\":\"cfad132f-d24b-49b3-a7ac-73d5b6905902\",\"nextBusinessStatusId\":null,\"ServerSDKTestid\":\"e796bdd6-efe6-43e6-b76a-6842d3197735\",\"method\":\"methodology\",\"userId\":\"4afdc8a9-eb91-4359-81d6-c3a462fae866\",\"createdByUserId\":\"4afdc8a9-eb91-4359-81d6-c3a462fae866\",\"modifiedByUserId\":\"4afdc8a9-eb91-4359-81d6-c3a462fae866\",\"businessUnitId\":\"a3d2909b-df67-49d6-b7e0-2dc912c12484\",\"createdOn\":\"2020-01-10T10:24:48Z\",\"modifiedOn\":\"2020-01-31T13:58:25Z\",\"entityStatusId\":\"faccc388-151a-4c83-8953-cbac7d6c442a\",\"file\":\"[{\\\"Name\\\":\\\"Quote_and_Buy_extended_data_model.png\\\",\\\"RealName\\\":\\\"Quote_and_Buy_extended_data_model_d9bf2c95-ab7d-4acc-befb-4b5d448f09f6.png\\\",\\\"IsSuccess\\\":true,\\\"Message\\\":null,\\\"ClientScript\\\":null,\\\"Serialized\\\":null,\\\"ErrorCode\\\":0,\\\"UIResult\\\":null}]\",\"primaryattributedisplayname\":\"blanao2\",\"aLookup1_name\":\"status2\",\"previousBSId_displayname\":\"status2\",\"aLookup2_name\":\"status3\",\"businessStatusId_displayname\":\"status3\",\"aLookup3_name\":null,\"nextBusinessStatusId_displayname\":null,\"aLookup4_userName\":\"jdoe\",\"userId_displayname\":\"jdoe\",\"aLookup5_userName\":\"jdoe\",\"createdByUserId_displayname\":\"jdoe\",\"aLookup6_userName\":\"jdoe\",\"modifiedByUserId_displayname\":\"jdoe\",\"aLookup7_name\":\"root\",\"businessUnitId_displayname\":\"root\",\"aLookup8_name\":\"Active\",\"entityStatusId_displayname\":\"Active\"}],\"Message\":null,\"IsSuccess\":true,\"ClientScript\":null,\"Serialized\":null,\"ErrorCode\":0,\"UIResult\":null}",
    "StatusCode": 200
}
NOTE  
The Response key in the result is a string, not a JSON object as when using the httpPost function.

Examples