Feature #37402
Make request handling RESTfuller
Status: | Resolved | Start date: | 2012-05-22 | ||
---|---|---|---|---|---|
Priority: | Should have | Due date: | |||
Assigned To: | Robert Lemke | % Done: | 70% |
||
Category: | Http | ||||
Target version: | TYPO3 Flow Base Distribution - 1.1 beta 2 | ||||
PHP Version: | 5.3 | Complexity: | medium | ||
Has patch: | No |
Description
Currently quite some work is required in order to create a FLOW3 based REST service. See comments: https://github.com/bwaidelich/REST-Test/commit/08749c0304d0f917781ca29f558dbb83f610fb57
Those features should be part of the core IMO:
format negotiation:¶
We used to have a convenience method Environment:getAcceptedFormats() that determined the accepted format from the requests accept headers. The http request should be able to determine those itself.
Note: It would be nice if the request had a list of accepted formats so the controller could specify a list of supported formats and the first match would be used.
consume input streams (see #36913)¶
Streams should be converted to arguments for POST & PUT requests.
Based on the content type the stream needs to be parsed (see https://github.com/bwaidelich/REST-Test/blob/master/Classes/RestRequestHandler.php#L119)
improve provided RestController¶
The RestController should be able to set the Content-Type header of the response according to some pattern (see https://github.com/bwaidelich/REST-Test/blob/master/Classes/Controller/AbstractRestController.php#L40)
Also redirection and error handling need to be adjusted
I don't know what we could achieve for 1.1 still, but maybe we can at least make it easier for 3rd parties to hook in
Related issues
Associated revisions
[TASK] IdentityRoutePart should return __identity array
IdentityRoutePart::matchValue() currently returns the identifier
of the ObjectPathMapping record directly.
This makes it difficult to merge arguments with data from the
requestBody (e.g. for PUT requests).
This change adjusts the route part so that it sets $this->value
to an array in the format array('__identity' => '<Identifier>')
Change-Id: I8b8cca1e20a2caf85ba51680ca79c4d74c16ed8b
Fixes: #37403
Related: #37402
Releases: 1.1, 1.2
[FEATURE] Support for HTTP PUT/DELETE arguments
This adds transparent argument support for arguments
in PUT and DELETE requests which are passed through
the request body. Depending on the content type of
the request, the message body is parsed and then
mapped into arguments for further use in controllers.
The following content content types are currently
supported:
- application/x-www-form-urlencoded
- application/json
- xml
Change-Id: Ifa6712e38d68c94cd9ec79a499d25ee577fc2d57
Resolves: #36913
Related: #37402
Related: #33371
Releases: 1.1, 1.2
[FEATURE] Support for HTTP PUT/DELETE arguments
This adds transparent argument support for arguments
in PUT and DELETE requests which are passed through
the request body. Depending on the content type of
the request, the message body is parsed and then
mapped into arguments for further use in controllers.
The following content content types are currently
supported:
- application/x-www-form-urlencoded
- application/json
- xml
Change-Id: Id938025a7359b6ec3b29cec5fd7259db97703a16
Resolves: #36913
Related: #37402
Related: #33371
Releases: 1.1, 1.2
[BUGFIX] Set property mapping configuration in RestController
Since Iac7bbb2a58ad890701fff2b0ad6b16a0e0b15bba we use a
whitelist-based approach to configure property mapping.
This change hooks into the create/update action of the
RestController and sets the required property mapping
configuration.
Change-Id: I6edbef57b42ed7afa176fbe231c500ff5fec8b14
Related: #37402
Related: #36776
Releases: 1.1, 1.2
[!!!][TASK] Switch from MIME to Media Types
The term MIME type is outdated, at least if used in a web context. The correct
term is "Internet Media Type". Furthermore, our list of MIME types (or media
types) was not up to date.
This patch introduces a new utility class "MediaTypes" which replaces
"FileTypes". Along with the new class comes a script which allows the core team
to conveniently update the list of Media Types and filename extensions.
This is a breaking change as the FileTypes class is deprecated with it. The old
methods are still available but should not be used anymore. A code migration to
use the new ones instead is shipped with the change.
Change-Id: I8f0997f79f09c828dbce5c7a34b4487a522aab0c
Related: #37402
Related: #33371
Releases: 1.1, 1.2
[!!!][TASK] Switch from MIME to Media Types
The term MIME type is outdated, at least if used in a web context. The correct
term is "Internet Media Type". Furthermore, our list of MIME types (or media
types) was not up to date.
This patch introduces a new utility class "MediaTypes" which replaces
"FileTypes". Along with the new class comes a script which allows the core team
to conveniently update the list of Media Types and filename extensions.
This is a breaking change as the FileTypes class is deprecated with it. The old
methods are still available but should not be used anymore. A code migration to
use the new ones instead is shipped with the change.
Change-Id: I8f0997f79f09c828dbce5c7a34b4487a522aab0c
Related: #37402
Related: #33371
Releases: 1.1, 1.2
[TASK] IdentityRoutePart should return __identity array
IdentityRoutePart::matchValue() currently returns the identifier
of the ObjectPathMapping record directly.
This makes it difficult to merge arguments with data from the
requestBody (e.g. for PUT requests).
This change adjusts the route part so that it sets $this->value
to an array in the format array('__identity' => '<Identifier>')
Change-Id: I8b8cca1e20a2caf85ba51680ca79c4d74c16ed8b
Fixes: #37403
Related: #37402
Releases: 1.1, 1.2
History
#1 Updated by Robert Lemke about 3 years ago
- Tracker changed from Task to Feature
- Category changed from MVC to Http
- Status changed from New to Accepted
- PHP Version set to 5.3
- Complexity set to medium
#2 Updated by Karsten Dambekalns about 3 years ago
- % Done changed from 0 to 70
#3 Updated by Karsten Dambekalns about 3 years ago
- Status changed from Accepted to Resolved
Almost done, the remaining work will be done for 1.2, see #37604.
#4 Updated by Bastian Waidelich over 2 years ago
Moved comments to #37604