Skip to content

Empty responses do not work #49

@hskrasek

Description

@hskrasek

For the delete requests of my API, I like to return 204 (no content) when it succeeds. Usually I would do Response::make('', 204);, and that would work fine. But it seems that when the router goes to morph the response, it turns empty string into a null, which then gets json_encoded to "null", and winds up giving a Malformed JSON error for anything consuming the response.

The request still works, but I'd like to remove the Malformed JSON error. Anyone else ran into this and find a work around?

When I get time after work, I'll look into finding a nice way to check for empty responses, and send in a PR if necessary

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