Skip to content

add JSON API endpoint support to prevent: Content Type Conversion #14

@ankitsejwal

Description

@ankitsejwal

Pgweb only accepts form data, forcing us for JSON→form conversion

// Convert JSON body to form data for pgweb compatibility
  const formData = new URLSearchParams()
  Object.entries(req.body || {}).forEach(([key, value]) => {
    formData.append(key, String(value))
  })
  fetchOptions.body = formData.toString()
  fetchOptions.headers['Content-Type'] =
  'application/x-www-form-urlencoded'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions