httpresponse

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package httpresponse contains the httpResponse node implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPResponse

type HTTPResponse struct {
	*nodebase.BaseNode
	// contains filtered or unexported fields
}

HTTPResponse 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.

func NewHTTPResponse

func NewHTTPResponse(node nodestore.NodeInterface, config *HTTPResponseConfig, host nodebase.NodeHost) *HTTPResponse

NewHTTPResponse creates a new HTTP response node

func (*HTTPResponse) Execute

Execute resolves the pending request associated with the message

type HTTPResponseConfig

type HTTPResponseConfig struct {
	// StatusCode is the HTTP status sent with the reply (default 200).
	// Overridden per message by Metadata["statusCode"] or
	// Data["statusCode"] — Node-RED's msg.statusCode equivalent.
	StatusCode int `json:"statusCode"`
	// Headers are extra response headers. Per-message
	// Metadata["headers"] / Data["headers"] maps are merged on top —
	// Node-RED's msg.headers equivalent.
	Headers map[string]string `json:"headers,omitempty"`
}

HTTPResponseConfig holds configuration for the HTTP response node

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL