私はxpagesからyandex Jsonインターフェイスapiへのjsonリクエストを作成するのに役立つ必要があります。このAPIのjson httpsリクエストを設定する方法 https://tech.yandex.com/translate/doc/dg/reference/translate-docpage/#codesxpagesからyandexへのjsonリクエストの作成方法api
または
URL myURL = new URL(serviceURL);
HttpURLConnection myURLConnection = (HttpURLConnection)myURL.openConnection();
String userCredentials = "username:password";
String basicAuth = "Basic " + new String(new Base64().encode(userCredentials.getBytes()));
myURLConnection.setRequestProperty ("Authorization", basicAuth);
myURLConnection.setRequestMethod("POST");
myURLConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
myURLConnection.setRequestProperty("Content-Length", "" + postData.getBytes().length);
myURLConnection.setRequestProperty("Content-Language", "en-US");
myURLConnection.setUseCaches(false);
myURLConnection.setDoInput(true);
myURLConnection.setDoOutput(true);
サンプルコードBLOKこれを行うには、この
https://translate.yandex.net/api/v1.5/tr.json/translate ?
key=<API key>
& text=<text to translate>
& lang=<translation direction>
& [format=<text format>]
& [options=<translation options>]
& [callback=<name of the callback function>]
あなたはいくつかの良い答えが得られているようです。私は自分自身を追加するつもりですが、それは非常に区別できる答えではなく、私の瞬間(私のブログのもの)(https://edm00se.io/xpages/rest-consumption-server-side/)私の意見では少し更新する必要があります。 Stephan(stwissel)アプローチは、おそらく、彼が言及したような 'xe:restService'や他のもので実装するのが簡単だと思います。 –