Alias to oauthEncode.
Signs a request and returns the relevant parameters for the "Authorization" header.
Calculates the signature for a request.
OAuthSession session; session.config.consumerKey = "(... obtain from service ...)"; session.config.consumerSecret = "(... obtain from service ...)"; session.token = "(... obtain from service ...)"; session.tokenSecret = "(... obtain from service ...)"; ... UrlParameters parameters; parameters["payload"] = "(... some data here ...)"; auto request = new HttpRequest; auto queryString = parameters.byPair.map!(p => session.encode(p.key) ~ "=" ~ session.encode(p.value)).join("&"); auto baseURL = "https://api.example.com/endpoint"; auto fullURL = baseURL ~ "?" ~ queryString; request.resource = fullURL; request.method = "POST"; request.headers["Authorization"] = session.prepareRequest(baseURL, "POST", parameters).oauthHeader; httpRequest(request, null);
Implements an OAuth client session.