Skip to content

res.json only support code 200 when body is undefined #1649

@ix-xerri

Description

@ix-xerri

I'm building a REST API and only need to send error codes from the server. Messages are being handled by the client.

res.json(200); works.

res.json(304); does not. 304 becomes the body with the status being changed to 200.

res.json(304, {}); works.

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