ComfyUI Node

HTTP OPTIONS Request

Ask the server what it'll let you do

By wawahuy·Created about a year ago·Updated 11 months ago· 14
HTTP OPTIONS Request
  • session
  • auth
  • status_code
  • headers
  • allowed_methods
  • cors_headers
  • content
urlhttps://api.example.com/data
headers{}
timeout30
verify_ssltrue
allow_redirectstrue
cookies{}
proxy_url

OPTIONS is the "what are my options?" request. It doesn't fetch or change anything - it asks the server which HTTP methods an endpoint allows and what its CORS rules are. HTTP OPTIONS Request is the pack's node for that niche but genuinely useful job: when an API's docs are thin and you want to know, empirically, whether it accepts PUT on that URL, or when a service is rejecting your browser-side requests for CORS reasons and you want to see what it claims to allow.

Be honest about your odds of needing this one: in a typical image-generation workflow it never shows up. But it's here, it's tiny, and it's the right tool for the one week a year you're fighting an undocumented API.

How it works

One required input, url. Then the standard optional set: session, auth, headers, timeout, verify_ssl, allow_redirects, cookies, proxy_url. It's the same plumbing as every other method node - auth and session work exactly as they do on HTTPGet.

The interesting part is the five outputs, which do the header-reading for you:

  • status_code - as always, your go/no-go signal.
  • headers - the full response headers as JSON.
  • allowed_methods - the value of the Allow header, e.g. GET, HEAD, PUT, DELETE. This is the "can I actually PUT here?" answer.
  • cors_headers - a JSON object of the Access-Control-* headers, if the server sent any.
  • content - the raw body (usually empty for OPTIONS).

How it fits

Pre-flight your workflow: before wiring up a batch of PUT requests against an unfamiliar API, fire an OPTIONS call, glance at allowed_methods, and you'll know whether you're about to get a wall of 405s. For CORS debugging - figuring out why a remote service won't accept cross-origin calls from your ComfyUI setup - cors_headers shows you the server's stated position without a browser in the way.

Install

ComfyUI Manager → search "ComfyUI-HTTP" → Install, restart. Manual:

cd ComfyUI/custom_nodes/
git clone https://github.com/wawahuy/ComfyUI-HTTP.git
cd ComfyUI-HTTP
pip install -r requirements.txt

No models, no extra dependencies.

Where people get burned

Some servers don't answer OPTIONS with an Allow header at all, or only answer specific paths - so an empty allowed_methods output is normal, not a bug. And remember many APIs gate OPTIONS behind the same auth as everything else, so if you get a 401, plug in your auth node. Finally, CORS is a browser-enforcement mechanism; ComfyUI's requests library doesn't enforce it. cors_headers tells you what the server declares - useful intel, but not a blocker the way it would be in a browser.

CategoryHTTP/Methods

Inputs (9)

NameTypeDefaultDescription
urlSTRINGhttps://api.example.com/data
sessionoptHTTP_SESSION
authoptHTTP_AUTH
headersoptSTRING{}
timeoutoptINT301–300
verify_ssloptBOOLEANtrue
allow_redirectsoptBOOLEANtrue
cookiesoptSTRING{}
proxy_urloptSTRING

Outputs (5)

NameTypeDescription
status_codeINT
headersSTRING
allowed_methodsSTRING
cors_headersSTRING
contentSTRING