質量

特技は長座体前屈です

Product Advertising API メモ

参考になった URL

Signature

http://docs.aws.amazon.com/AWSECommerceService/latest/DG/rest-signature.html の 9 番目の話。 Java で普通に URL エンコード(URLEncoder.encode)しても * - _の 3 つの記号がエンコードされない。Product Advertising API にはエンコードしたものを渡さないといけないので、普通にリプレイスした。

/**
 * "-" と "_" も URL エンコードする
 *
 * @return URL エンコードした文字列
 */
public static String urlEncode(String text) {
    try {
        text = URLEncoder.encode(text, "UTF-8");
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    }
    text = text.replaceAll("_", "%2F");
    text = text.replaceAll("-", "%2B");
    return text;
}

1/10 位の確率で 503 エラーになる

時間置いてリトライしないとダメ