Skip to content

application/x-www-form-urlencoded request ends up as text/plain #3

@itsameandrea

Description

@itsameandrea

Hey there!

I'm using supafetch in a Nuxt project. I have initialized Supafetch as below:

supafetch.setBaseUrl('https://staging.keyrun.app/api')
  
supafetch.setDefaultHeaders({
  'Content-Type': 'application/x-www-form-urlencoded',
})

And then I'm making a post request:

this.$http.post('/authenticated/profiles', {
  data: {
    profilename: payload.sellingProfile,
    keyprefix: payload.keyPrefix,
    website: payload.website,
    users: payload.users.join(',')
  }
})

I would expect the call to have application/x-www-form-urlencoded, however, it ends up as text/plain. Any idea?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions