Wird ein Flow durch eine HTTP-Anfrage gestartet, so kann dieser die an den Aufrufer gesendete HTTP-Antwort erstellen. Diese Funktionalität steht nur dann zur Verfügung, wenn die Ausführungsart des Flows auf “Synchron” gesetzt, d. h. der Aufrufer erst nach der Ausführung des Flows eine HTTP-Antwort erhält. Die Ausführungsart kann jederzeit im Flow Studio angepasst werden.
Um bestimmte eine HTTP-Antwort zu generieren, muss der Flow diese im Flow-Kontext unter dem JSON-Pfad $.out.eventData ablegen. Soll nur der JSON-Inhalt der Antwort festgelegt werden, so genügt es, diesen unter dem JSON-Pfad If a flow is started by an HTTP request, it can create the HTTP response sent to the caller. This functionality is only available if the execution type of the flow is set to "Synchronous", i.e. the caller only receives an HTTP response after the flow has been executed. The execution type can be adjusted at any time in Flow Studio.
To generate a specific HTTP response, the flow must store it in the flow context under the JSON path $.out.eventData. If only the JSON content of the response is to be defined, it is sufficient to store this under the JSON path $.out.eventData.content abzulegen.
Die vollständige Struktur der HTTP-Antwort entnehmen Sie bitte dem Typ “http_response” aus folgendem JSON-SchemaThe complete structure of the HTTP response can be found in the type "http_response" from the following JSON schema:
Code Block | ||
---|---|---|
| ||
{ "$id": "https://connect.galileo-group.de/services/galileogroup/connect/1.0/schemas/http.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "JSON Schema for HTTP specific types (v1.0)", "$defs": { "http_header": { "type": "object", "properties": { "key": { "type": "string", "title": "Name (key)" }, "value": { "type": "string", "title": "Value" } }, "required": [ "key" ], "title": "HTTP header" }, "http_headers": { "type": "array", "items": { "$ref": "#/$defs/http_header" }, "default": [], "title": "Array of HTTP headers" }, "http_params": { "type": "object", "title": "HTTP request parameters used in URI and/or query string" }, "http_content": { "title": "HTTP content (generic)" }, "http_status": { "type": "object", "properties": { "httpStatusCode": { "type": "number", "title": "HTTP status code" }, "reason": { "type": "string", "default": "", "title": "HTTP status reason" } }, "required": [ "httpStatusCode" ], "title": "HTTP response status" }, "http_request": { "type": "object", "properties": { "headers": { "$ref": "#/$defs/http_headers" }, "params": { "$ref": "#/$defs/http_params" }, "content": { "$ref": "#/$defs/http_content" }, "status": { "$ref": "#/$defs/http_status" } }, "title": "HTTP request" }, "http_response": { "type": "object", "properties": { "headers": { "$ref": "#/$defs/http_headers" }, "content": { "$ref": "#/$defs/http_content" }, "status": { "$ref": "#/$defs/http_status" } }, "title": "HTTP response" } } } |
...