コード例 #1
0
 public void addRequestHeaders(NativeObject headersNO) {
   if (headersNO != null) {
     for (Object o : headersNO.getAllIds()) {
       Object val = headersNO.get(o.toString(), null);
       if (val instanceof NativeArray) {
         NativeArray arr = (NativeArray) val;
         for (int i = 0; i < arr.getLength(); i++) {
           method.addHeader(o.toString(), arr.get(i, null).toString());
         }
       } else {
         method.addHeader(o.toString(), val.toString());
       }
     }
   }
 }
コード例 #2
0
 public void addRequestParameters(NativeObject paramsNO) {
   if (paramsNO != null) {
     for (Object o : paramsNO.getAllIds()) {
       Object val = paramsNO.get(o.toString(), null);
       if (val instanceof NativeArray) {
         NativeArray arr = (NativeArray) val;
         for (int i = 0; i < arr.getLength(); i++) {
           addRequestParameter(o.toString(), arr.get(i, null).toString());
         }
       } else {
         addRequestParameter(o.toString(), val.toString());
       }
     }
   }
 }