Skip to content

RESTful: Handle single field request with empty value #18

@weierophinney

Description

@weierophinney

Controller/AbstractRestfulController

There is no way to PUT/PATCH object with single field to empty value.

PUT /item/1
Content-Type: application/x-www-form-urlencoded

name=

Request payload is interpreted as string ($data = 'name=';) regardless Content-Type.
Proper value is $data = ['name' => ''];

I think ideally is split behaviour by Content-Type but that follows to huge BC. (see testCanReceiveStringAsRequestContent)

My pull request handle just one situation (example above) by header.


Originally posted by @autowp at zendframework/zend-mvc#251

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions