On Sat, 02 Jul 2016 09:11:11 GMT, Sönke Ludwig wrote:
On Mon, 20 Jun 2016 21:38:20 +0200, Jacob Carlborg wrote:
(...)
I see. Is it possible to somehow to do with the current version of
vibe.d, using some form of middleware of before hook? I thinking that
request could be modified to something the REST generator expects./Jacob Carlborg
If you just need to model the server side, it should work with
@before
:private Json extractContents(HTTPServerRequest req, HTTPServerResponse res) {
return parseJsonString(req.form["someparam"]);
} @before!extractContents("contents") void postSomething(Json contents) { // ... }
The client side wouldn't really work, though, AFAICS.
Sorry, mixed up the topic. Corrected extractContents
is above. I didn't test this, so I'm not 100% sure that the interface generator doesn't try to access the body as a JSON object, but if it does, that would at least be easily fixable.