}
private String getRequestToken(final Request request) throws AuthException {
final Configuration c = getConfiguration();
final List<NameValuePair> params = getRequestTokenParams(request, c);
final WSResponse r = WS.url(c.getString(SettingKeys.REQUEST_TOKEN_URL))
.setHeader("Content-Type", "application/json")
.setHeader("X-Accept", "application/json")
.post(encodeParamsAsJson(params)).get(getTimeout());
if (r.getStatus() >= 400) {
throw new AuthException(r.asJson().asText());
} else {
return r.asJson().get(PocketConstants.CODE).asText();
}
}