{"modulePath":"github.com/dracory/nodebase","version":"v0.8.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package httpresponse\n\nPackage httpresponse contains the httpResponse node implementation.\n\n## Types\n\n```go\ntype HTTPResponse struct {\n\t*nodebase.BaseNode\n\t// contains filtered or unexported fields\n}\n```\nHTTPResponse answers the HTTP request that injected the current message. It correlates via the msgId in payload.Metadata, set by httpTrigger. Response status and headers travel back through the message metadata so the trigger handler can write them.\n\n```go\nfunc NewHTTPResponse(node nodestore.NodeInterface, config *HTTPResponseConfig, host nodebase.NodeHost) *HTTPResponse\n```\nNewHTTPResponse creates a new HTTP response node\n\n```go\nfunc (n *HTTPResponse) Execute(ctx context.Context, input nodestore.MessageInterface) (nodestore.MessageInterface, error)\n```\nExecute resolves the pending request associated with the message\n\n```go\ntype HTTPResponseConfig struct {\n\t// StatusCode is the HTTP status sent with the reply (default 200).\n\t// Overridden per message by Metadata[\"statusCode\"] or\n\t// Data[\"statusCode\"] — Node-RED's msg.statusCode equivalent.\n\tStatusCode int `json:\"statusCode\"`\n\t// Headers are extra response headers. Per-message\n\t// Metadata[\"headers\"] / Data[\"headers\"] maps are merged on top —\n\t// Node-RED's msg.headers equivalent.\n\tHeaders map[string]string `json:\"headers,omitempty\"`\n}\n```\nHTTPResponseConfig holds configuration for the HTTP response node\n\n","path":"github.com/dracory/nodebase/httpresponse","name":"httpresponse","synopsis":"Package httpresponse contains the httpResponse node implementation.","isRedistributable":true}
