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/json if 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.

Please authenticate to join the conversation.

Upvoters
Status

Canceled

Board

Feature

Tags

Low Priority

Date

10 months ago

Author

Alex Prieu

Subscribe to post

Get notified by email when there are changes.