I can't understand by docs what is the difference between registerRestInterface , registerWebInterface and RestInterfaceClient .
Both of them can generate methods by class. But I can't understand when I should use one and when another.
The key to understand the difference is to realize that vibe.web.rest
and vibe.web.web
are two different modules with a different use cases in mind:
When to use:
redirect
) @auth
( example ) When to use: web services, small APIs
I personally use vibe.web.web
more often as for my small projects the overhead of keeping the interface files in sync isn't worth it. Moreover, I like the convenient access to the request context and session variables in vibe.web.web
. In fact, I maintain a drop-in fork that adds more convenience feature (auto-serialization to/from Json, auto route /:param/ generation based on the method params, ...)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.