Info | ||
---|---|---|
| ||
This routine is available starting with SIL Engine™ 4.1.5. |
Syntax
appendToWebhookResponse(<array or primitive type>responsePart)
Description
Excerpt |
---|
Creates Adds an HttpHeader object to be used as Authorization header for a Basic authentication of a userthe response that will be returned to the Webhook caller, as the HTTP body. |
Parameters
Parameter name | Type | Required | Description |
---|---|---|---|
usernameresponsePart | string | Yes | The usernameobject to be added to the response. | password
Note |
---|
...
Return type
...
|
...
| |
If the responsePart parameter has another type but string, a conversion to string will be attempted. In this case, what will the actual resulting string look like, or event if it will exist, is uncertain. |
Example
Code Block |
---|
HttpHeader authHeader//getting the REST/HTTP call input parameters: WebhookPayload httpRequestPayload = httpBasicAuthHeader("admin", "admin");getWebhookPayload(); //getting the used HTTP method: string httpMethod = httpRequestPayload.httpMethod;//This can be something like "GET", "POST", "PUT" etc. //getting the http request payload (body): string httpPayload = httpRequestPayload.payload; //getting the http query parameters: WebhookParam[] httpQueryParams = httpRequestPayload.queryParams; string firstQueryParamName = httpQueryParams[0].name; string firstQueryParamValue = httpQueryParams[0].values[0]; //sending the response back to the caller: appendToWebhookResponse("http method:"); appendToWebhookResponse(httpMethod); appendToWebhookResponse("payload:"); appendToWebhookResponse(httpPayload); appendToWebhookResponse("firstQueryParamName:"); appendToWebhookResponse(firstQueryParamName); appendToWebhookResponse("firstQueryParamValue:"); appendToWebhookResponse(firstQueryParamValue); //returning a custom HTTP status code: return true, 1234; |
See also
Filter by label (Content by label) | ||||||||
---|---|---|---|---|---|---|---|---|
|
...