lib/util/rest.js
function lexPhrase(req, res) {
        var now    = elapse.start();
        var body   = req ? req.body : null;
        var phrase = typeof(body) === 'object' ? body.phrase : null;
        if (!phrase) {
            return res.jsonp(412, {"code":412, "message": meta.module + '|lex|EXCEPTION|invalid request body: ' + (body === null ? 'body is null' : 'phrase is null')});
        }
        body.words = api.lex(phrase);
        body.elapsedMs = elapse.stop(now).elapsed;
        res.jsonp(body);
    }
function lexPhrase(req, res) {
        var now    = elapse.start();
        var body   = req ? req.body : null;
        var phrase = typeof(body) === 'object' ? body.phrase : null;
        if (!phrase) {
            return res.jsonp(412, {"code":412, "message": meta.module + '|lex|EXCEPTION|invalid request body: ' + (body === null ? 'body is null' : 'phrase is null')});
        }
        body.words = api.lex(phrase);
        body.elapsedMs = elapse.stop(now).elapsed;
        res.jsonp(body);
    }
function lexPhrase ( req , res ) { var now = elapse . start ( ) ; var body = req ? req . body : null ; var phrase = typeof ( body ) === 'object' ? body . phrase : null ; if ( ! phrase ) { return res . jsonp ( 412 , { "code" : 412 , "message" : meta . module + '|lex|EXCEPTION|invalid request body: ' + ( body === null ? 'body is null' : 'phrase is null' ) } ) ; } body . words = api . lex ( phrase ) ; body . elapsedMs = elapse . stop ( now ) . elapsed ; res . jsonp ( body ) ; }
HTTP Request to lex a phrase

@param req: an HTTP request
@param res: an HTTP response

curl -X POST -H "Content-Type: application/json" -d '{"phrase":"bye there"}' http://tagger.beeker.c9.io/ws/lex/phrase
HTTP Request to lex a phrase