You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation says that out REST headerParams are response headers that you don't send to the server, but if you don't send the header to the server it complains about a missing non-optional header parameter:
import vibe.d;
shared staticthis()
{
auto settings = new HTTPServerSettings;
settings.port = 3000;
settings.bindAddresses = ["::1", "127.0.0.1"];
auto router = new URLRouter;
router.registerRestInterface(new Rest);
listenHTTP(settings, router);
}
interfaceIRest
{
@headerParam("a", "X-A-Header")
intgetFoo(outstring a);
}
classRest : IRest
{
intgetFoo(outstring a)
{
a = "hi";
return0;
}
}
Now open http://localhost:3000/foo and you would expect it to return 0 and send back the X-A-Header with hi as value, however it returns this:
The documentation says that
out
RESTheaderParam
s are response headers that you don't send to the server, but if you don't send the header to the server it complains about a missing non-optional header parameter:Now open http://localhost:3000/foo and you would expect it to return 0 and send back the
X-A-Header
withhi
as value, however it returns this:The text was updated successfully, but these errors were encountered: