Default Content-Type: application/json for REST and GraphQL Actions
Context:
Users are attempting to send form data from Clutch to external services like Directus, which expect application/json payloads. However, Clutch's current default behavior sends the body as plain text unless the header is manually set.
Problem:
REST/GraphQL actions do not default to sending
Content-Type: application/json, resulting in empty or invalid request bodies unless users manually set the header.This leads to confusion for users unfamiliar with header configuration, especially when trying to integrate with common services like Directus or WordPress.
Current workaround: users must manually add the header via the action config.
Proposed Solution:
Default
Content-Type: application/jsonif no header is set by the user.Allow header override: if a user explicitly defines
Content-Type, respect their value.Consider exposing a dropdown UI for commonly used headers like
Content-Type: application/json,Authorization, etc., to reduce manual setup and improve UX.
Design Suggestions:
UX reference: Strapi's GraphQL playground or Postman-style dropdowns.
Could be part of the REST/GraphQL action panel or a reusable presets module.
Log in to comment and vote
No comments yet
Be the first to share your thoughts.