← HTTP / Webhook

Return HTTP Response with HTTP / Webhook API

Pipedream makes it easy to connect APIs for HTTP / Webhook and 800+ other apps remarkably fast.

Trigger workflow on
HTTP requests, schedules and app events
Next, do this
Return HTTP Response with the HTTP / Webhook API
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜
Trusted by 250,000+ developers from startups to Fortune 500 companies:
Trusted by 250,000+ developers from startups to Fortune 500 companies

Developers Pipedream

Getting Started

Create a workflow to Return HTTP Response with the HTTP / Webhook API. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Configure the Return HTTP Response action
    1. Connect your HTTP / Webhook account
    2. Configure Response Status Code
    3. Optional- Configure Response Headers
    4. Optional- Configure Response Body
  2. Select a trigger to run your workflow on HTTP requests, schedules or app events
  3. Deploy the workflow
  4. Send a test event to validate your setup
  5. Turn on the trigger

Details

This is a pre-built, open source component from Pipedream's GitHub repo. The component is developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Return HTTP Response on HTTP / Webhook
Description:Use with an HTTP Source that uses `Return a custom response from your workflow` as its `HTTP Response`
Version:0.0.1
Key:http-return-http-response

Code

import http from "../../http.app.mjs";

export default {
  key: "http-return-http-response",
  name: "Return HTTP Response",
  description:
    "Use with an HTTP Source that uses `Return a custom response from your workflow` as its `HTTP Response`",
  type: "action",
  version: "0.0.1",
  props: {
    http,
    resStatusCode: {
      type: "integer",
      label: "Response Status Code",
      description:
        "The [status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) to return in the HTTP response.",
      default: 200,
      min: 100,
      max: 599,
    },
    resHeaders: {
      type: "object",
      label: "Response Headers",
      description: "The headers to return in the HTTP response.",
      optional: true,
    },
    resBody: {
      type: "any",
      label: "Response Body",
      description: "The body to return in the HTTP response.",
      optional: true,
      default: "{ \"success\": true }",
    },
  },
  async run({ $ }) {
    const status = this.resStatusCode;
    await $.respond({
      status,
      headers: this.resHeaders,
      body: this.resBody,
    });
    $.export("summary", `Responded successfully with status ${status}`);
  },
};

Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
HTTP / WebhookhttpappThis component uses the HTTP / Webhook app.
Response Status CoderesStatusCodeinteger

The status code to return in the HTTP response.

Response HeadersresHeadersobject

The headers to return in the HTTP response.

Response BodyresBodyany

The body to return in the HTTP response.

Authentication

The HTTP / Webhook API does not require authentication.

About HTTP / Webhook

Get a unique URL where you can send HTTP or webhook requests