GET
/rests?p1=1&p2=Hello
502670
public function actionIndex()
    {
        $data = [
            [
                'f1' => $this->getContext()->getInput()->get('p1'),
                'f2' => $this->getContext()->getInput()->get('p2'),
            ],
            [
                'f1' => $this->getContext()->getInput()->get('p1'),
                'f2' => $this->getContext()->getInput()->get('p2'),
            ]
        ];
        $this->outputJson($data);
        //$this->outputJson(null, 'canshucuowuyo', 401);
    }
1233899
def rest_get(self, url, params=None, headers=None, auth=None, verify=True, cert=None):
        
        res = requests.get(url, params=params, headers=headers, auth=auth, verify=verify,
                           cert=cert)
        return res.text, res.status_code
103065
def jsd(p1, p2):
    
    m = (p1 + p2) / 2
    return (kld(p1, m) + kld(p2, m)) / 2
1140052
function params(p) {

  var result = "";
  _.each(p, function (val) {
    result = result + spliter + val;
  });

  return result;
}
699713
def second_params_two(test, two):
    
    if request.method == 'POST':
        return [test, two, request.data]
    return {'result': [test, two]}
1156321
def _rest_post(self, suburi, request_headers, request_body):
        
        return self._rest_op('POST', suburi, request_headers, request_body)
458034
def rest(self, token, endpoint=None, timeout=None):
        """"""
        from . import rest
        return rest.SignalFxRestClient(
            token=token,
            endpoint=endpoint or self._api_endpoint,
            timeout=timeout or self._timeout)
1166956
def parent_for_matching_rest_name(self, rest_names):
        

        parent = self

        while parent:
            if parent.rest_name in rest_names:
                return parent

            parent = parent.parent_object

        return None
1266134
JCExpression term1() {
        JCExpression t = term2();
        if ((mode & EXPR) != 0 && token.kind == QUES) {
            mode = EXPR;
            return term1Rest(t);
        } else {
            return t;
        }
    }
187861
@Nonnull
  public String getRest ()
  {
    final String ret = m_sInput.substring (m_nCurIndex);
    m_nCurIndex = m_nMaxIndex;
    return ret;
  }
1147457
def _rest(url, req, data=None):
    """"""
    if url.upper().startswith("HTTPS"):
        print("Secure connection required: Please use HTTPS or https")
        return ""

    req = req.upper()
    if req != "GET" and req != "PUT" and req != "POST" and req != "DELETE":
        return ""

    status, body = _api_action(url, req, data)
    if (int(status) >= 200 and int(status) <= 226):
        return body
    else:
        return body
537425
function stringStartsWith (str, val, startIndex) {
  var rest = '' + str
  return (arguments.length === 1 ? rest : rest.substring(startIndex)).indexOf(val) === 0
}
257506
def content_item(path1, path2, path_sep='/'):
    
    p1_parts = path1.split(path_sep)
    p2_parts = path2.split(path_sep)
    # special case when path1 is root
    if path1 == path_sep and len(p2_parts) >= 2:
        return p2_parts[1]
    if len(p2_parts) <= len(p1_parts):
        return ''
    for i, item in enumerate(p1_parts):
        if item != p2_parts[i]:
            return ''
    return p2_parts[i+1]
675964
public function rest()
    {
        $rest = substr($this->src, $this->index);
        if ($rest === false) {
            $rest = '';
        }
        return $rest;
    }
180684
def rest_of_key(namespace)
      return nil if @key == namespace

      key = @key.to_s

      index = key.index(namespace.to_s) && (namespace.to_s.length + 1)
      key[index, key.length].to_sym if index
    end
36825
function postRest(uri) {
    var callback = preConditions.getCallback(arguments[arguments.length - 1]);
    var options;

    showWarning();

    options = {
      path: uri,
      method: 'POST',
      payload: (arguments[1] !== undefined && typeof arguments[1] !== 'function') ? arguments[1] : {},
      config: {
        qs: (arguments[2] !== undefined && typeof arguments[2] !== 'function') ? arguments[2] : {}
      }
    };

    return requestManager.generateAccessToken(function (err) {
      // Return callback if an error ocurr getting the access_token
      if (err) return callback.apply(null, [err, null]);
      return false;
    }).then(function (accessToken) {
      options.access_token = accessToken;
      return requestManager.exec(options, callback);
    });
  }
1101370
def rest_post(self, url, params=None, headers=None, auth=None, verify=True, cert=None):
        
        res = requests.post(url, params=params, headers=headers, auth=auth, verify=verify,
                            cert=cert)
        return res.text, res.status_code