1

I am trying to send a post request to PostgREST to invoke a stored procedure:

  const data = await $fetch('http://http-logger:3001/rpc/test_proc', {
    method: 'post',
    headers: {
      Prefer: 'params=single-object',
      Accept: 'application/json',
      'Content-Type':  'application/json'
    },
    body: {some: 'json'}
})

Results in this request:

POST /rpc/test_proc HTTP/1.1
host: http-logger:3001
connection: keep-alive
prefer: params=single-object
accept: application/json
content-type: application/json, text/plain;charset=UTF-8
accept-language: *
sec-fetch-mode: cors
user-agent: undici
accept-encoding: gzip, deflate
content-length: 15


{"some":"json"}

I need to remove the 'text/plain;charset=UTF-8' part from the content-type. Is this possible? Should it even be there as I have explicitly defined the content-type header? Many thanks Ian

ianj
  • 11
  • 4

0 Answers0