Skip to content

Improve fetchBaseQuery content json verification  #2282

@danibonilha

Description

@danibonilha

Currently in the docs regarding the body it says:
// fetchBaseQuery automatically adds 'content-type: application/json' to the Headers and calls JSON.stringify(patch)
However it doesn't state that it only "stringifies" if the content-type is strictly application/json, I use application/vnd.api+json for example and it was not very easy to figure what was wrong.

My proposal is to check if the content-type contains the json extension, so it will cover all json cases, if no one sees any issues with this proposal I'd be glad to push a PR for it, otherwise we could at least update the docs to avoid any confusion.

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