The REST API is supported by a multi-threaded daemon that has the same core speed as the native ufdbGuard API. Due to REST protocol overhead, however, the number of URL classifications per second is less compared to the native API. Therefore, if performance is an important requirement, it is recommended to use the native API for URL classification and URL filtering.
The REST API daemon has the following properties:The REST client sends a query for a single URL.
GET http://ufdbrest1.prod.local/useparams/no/url/http%3A%2F%2Fwww.cnn.com%2Fshowbiz HTTP/1.1and the REST server replies
HTTP/1.1 200 OK { "url": "http%3A%2F%2Fwww.cnn.com%2Fshowbiz", "categories": [ "news", "entertainment" ], "reloading": "no" }
The REST client sends a query for a list of URLs. The maximum size of the list is currently 256.
POST http://ufdbrest1.prod.local/useparams/no/geturllist.json HTTP/1.1 { "urls": [ "http%3A%2F%2Fwww.cnn.com%2Fshowbiz", ... ] }and the REST server replies
HTTP/1.1 200 OK { "urlcategories": [ { "url": "http%3A%2F%2Fwww.cnn.com%2Fshowbiz", "categories": [ "news", "entertainment" ] }, ... ] }