So i've been looking for a REST client that lets you specify path parameters the same way that express handles routes with params in them.
I've been superagent for most of my http needs, but I want something that goes one step further and automatically handles the encoding/replacing of parameters.
Ideally I'd be able to do something like this with a request builder:
var path = "/users/:userId/things/:thingName/:optionalParam?";
var params = { userId: 1, thingName: "My Super Thing & Stuff"; }
var query = { search: "my search", type: 1 };
rest.get()
.base('http://api.example.com')
.path(path, params)
.query(query)
.accept('json')
.end(function() {}); // actually execute the request
This would execute a request to:
What do people use for calling REST apis, besides manually constructing the URL by concatenating/encoding things?
I'd expect something like this to exist already, so before I make it I wanted to check with the community.