Skip to content

Possible gap in documentation re res.json and res.jsonp #1330

Description

@jafrank88

The documentation for 4.x, under res.jsonp() says, "res.jsonp([body])
Sends a JSON response with JSONP support. This method is identical to res.json(), except that it opts-in to JSONP callback support."

It appears that part of res.jsonp involves changing the content-type from 'application/json' to 'text/javascript'. I understand why this happens (RFC JSON Schema), but is there a setting or other way to keep the 'incorrect' content-type? Otherwise, maybe amend the documentation to note all the ways in which res.jsonp differs from res.json.
Thanks for considering it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsIssues/pr concerning contentquestion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions