vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Function method

Attribute to force a specific HTTP method for an interface method.

vibe.web.common.MethodAttribute method (
  HTTPMethod data
) @safe;

The usual URL generation rules are still applied, so if there are any "get", "query" or similar prefixes, they are filtered out.

Example

interface IAPI
{
	// Will be "POST /info" instead of default "GET /info"
	@method(HTTPMethod.POST) string getInfo();
}
Authors

Sönke Ludwig, Михаил Страшун

Copyright

© 2012-2017 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.