npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

directus-extension-request-url-with-more-settings

v1.0.2

Published

Send HTTP requests with advanced settings: redirect behavior, and optional raw body output

Downloads

14

Readme

directus-extension-request-url-with-more-settings

A Directus Flow operation to send HTTP requests with advanced settings: custom method, URL, headers, body, redirect behavior, and optional raw body output.

  • Operation type: operation
  • Language: TypeScript
  • Uses global fetch (Node.js 18+)
  • Output shape compatible with Directus built-in “request” operation:
    • { status, statusText, headers, data?, rawBody? }

Features

  • HTTP method: GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS (or any custom)
  • URL
  • Headers: list of { header, value }
  • Body (auto-JSON when object and no Content-Type provided)
  • followRedirects: follow or not (manual) redirects
  • rawBody: optionally returns base64-encoded raw response body as a Data URL
  • Smart response parsing:
    • JSON → parsed into data
    • text/* → parsed into data
    • binary (e.g. image, pdf) → data omitted, only rawBody returned
  • Can be used to forward or upload remote files (e.g. fetch image → send to another API)

Usage in a Flow

  • Add operation: HTTP Request (Advanced)
  • Options:
    • Method: e.g., GET
    • URL: e.g., https://httpbin.org/get?hello=world
    • Headers: []
    • Body: empty or JSON
    • Follow redirects: true/false
    • Return raw body (base64 Data URL): true/false

Output

Example with JSON:

{
  "status": 200,
  "statusText": "OK",
  "headers": {
    "content-type": "application/json"
  },
  "data": { "example": "value" }
}

Example with HTML when rawBody = true:

{
  "status": 200,
  "statusText": "OK",
  "headers": { "content-type": "text/html" },
  "data": "<html>...</html>",
  "rawBody": "data:text/html;base64,PGh0bWw+Li4uPC9odG1sPg=="
}

Example with an image file when rawBody = true:

{
  "status": 200,
  "statusText": "OK",
  "headers": { "content-type": "image/jpeg" },
  "rawBody": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ..."
}

Note: in this case, data is omitted because the response is binary.

Options Reference

  • method: string (default: GET)
  • url: string (required)
  • headers: Array<{ header: string; value: string }>
  • body: any
  • followRedirects: boolean (default: true)
  • rawBody: boolean (default: false)

Behavior

  • When body is an object and Content-Type isn’t set, it is sent as JSON (application/json; charset=utf-8).
  • When followRedirects = false, fetch uses redirect: "manual".
  • Response parsing:
    • If Content-Type includes application/json → parsed as JSON in data.
    • If Content-Type starts with text/ → parsed as text in data.
    • Otherwise (binary file) → omit data, only return rawBody as base64 Data URL.

Example Flow

  • Trigger: Webhook (key: test-http)
  • Step 1: HTTP Request (Advanced)
    • Method: GET
    • URL: https://httpbin.org/get?hello=world
    • Follow redirects: true
    • Raw body: false
  • Optional Step 2: Log
    • Message: {{ steps.step1.status }} - {{ steps.step1.data.url }}

License

MIT Dan Denolf