http-request

command
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 14 Imported by: ? modules, 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.

README

HTTP Request

A noderun workflow demonstrating the httpRequest node — with the engine itself serving the target endpoint, so nothing external is needed:

httpTrigger (GET /api) → template → httpResponse     ← server branch
inject → httpRequest (GET /api) → debug              ← client branch

Both branches live in one workflow on one engine: the trigger node binds its own listener, and the request node calls it back.

Things to notice:

  • The httpRequest response payload is an object: {statusCode, status, headers, body, bodyTruncated, duration} — this example's debug node prints just payload.body.
  • If the response Content-Type is JSON (including application/*+json variants), body arrives already parsed as an object, not a string.
  • An empty url config can be supplied per message (msg.url) — Node-RED parity — and username/password are credential-typed fields for HTTP Basic auth, stored outside the exported flow.
  • The client branch is fired manually via FireInjectNode after a TCP probe confirms the trigger listener is bound — the inject must not race the listener, or the request would hit a port that isn't up yet.

Run from the noderun module root:

go run ./examples/http-request

Expected output:

Hello from the endpoint!

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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