Yes, you can do that its a directive just like rest or any user-defined directive, however, there are some pros and cons as stated below:
The invoke directive, like the rest directive, supports the GET, PUT, POST, and DELETE methods. For existing applications that use the invoke directive, you can update a service to call the pub.flow:getTransportInfo service and then perform a branch on /transport/http/method to execute the appropriate portions of your existing code.
However, that if you use the invoke directive instead of the rest directive, you cannot take advantage of these REST-specific features:
$resourceID pipeline variable
$path pipeline variable
_default service
Read the documentation for more insights.
#Integration-Server-and-ESB#webMethods