function to get the data from the urlencoded forms
        ignore the data passed in and just get the args from wherever they are
776558
def _form_loader(self, _):
        '''
        
        '''
        data = {}
        for key in self.request.arguments:
            val = self.get_arguments(key)
            if len(val) == 1:
                data[key] = val[0]
            else:
                data[key] = val
        return data
444635
def inputs(form_args):
    
    element = []
    for name, value in form_args.items():
        element.append(
            '<input type="hidden" name="{}" value="{}"/>'.format(name, value))
    return "\n".join(element)
420443
def _GetArgsFromRequest(self, request, method_metadata, route_args):
    """"""
    format_mode = GetRequestFormatMode(request, method_metadata)

    if request.method in ["GET", "HEAD"]:
      if method_metadata.args_type:
        unprocessed_request = request.args
        if hasattr(unprocessed_request, "dict"):
          unprocessed_request = unprocessed_request.dict()

        args = method_metadata.args_type()
        for type_info in args.type_infos:
          if type_info.name in route_args:
            self._SetField(args, type_info, route_args[type_info.name])
          elif type_info.name in unprocessed_request:
            self._SetField(args, type_info, unprocessed_request[type_info.name])

      else:
        args = None
    elif request.method in ["POST", "DELETE", "PATCH"]:
      try:
        args = method_metadata.args_type()
        for type_info in args.type_infos:
          if type_info.name in route_args:
            self._SetField(args, type_info, route_args[type_info.name])

        if request.content_type and request.content_type.startswith(
            "multipart/form-data;"):
          payload = json.Parse(request.form["_params_"].decode("utf-8"))
          args.FromDict(payload)

          for name, fd in iteritems(request.files):
            args.Set(name, fd.read())
        elif format_mode == JsonMode.PROTO3_JSON_MODE:
          # NOTE: Arguments rdfvalue has to be a protobuf-based RDFValue.
          args_proto = args.protobuf()
          json_format.Parse(request.get_data(as_text=True) or "{}", args_proto)
          args.ParseFromString(args_proto.SerializeToString())
        else:
          json_data = request.get_data(as_text=True) or "{}"
          payload = json.Parse(json_data)
          if payload:
            args.FromDict(payload)
      except Exception as e:  # pylint: disable=broad-except
        logging.exception("Error while parsing POST request %s (%s): %s",
                          request.path, request.method, e)
        raise PostRequestParsingError(e)
    else:
      raise UnsupportedHttpMethod("Unsupported method: %s." % request.method)

    return args
836616
def fix_url_object(obj, data = nil)
      if data
        obj.content_type = PLAIN
        obj.data = data
        obj.store
        return obj
      end
      case obj.content_type
        when /json/ then fix_url_object(obj, JSON.parse(%({"data":#{obj.raw_data}}))['data'])
        when PLAIN  then obj
        else fix_url_object(obj, obj.data) # old values had the right data but the content type was application/x-www-form-urlencoded
      end
    end
62417
public static function getDatas() {
		$method = \strtolower ( $_SERVER ['REQUEST_METHOD'] );
		switch ($method) {
			case 'post' :
				if (self::getContentType () == 'application/x-www-form-urlencoded') {
					return $_POST;
				}
				break;
			case 'get' :
				return $_GET;
			default :
				return self::getInput ();
		}
		return self::getInput ();
	}
1351968
public static String urlEncode(String str) throws UnsupportedEncodingException {
    // Preserve original behavior that passing null for an object id will lead
    // to us actually making a request to /v1/foo/null
    if (str == null) {
      return null;
    } else {
      // Don't use strict form encoding by changing the square bracket control
      // characters back to their literals. This is fine by the server, and
      // makes these parameter strings easier to read.
      return URLEncoder.encode(str, CHARSET)
        .replaceAll("%5B", "[")
        .replaceAll("%5D", "]");
    }
  }
524702
def urllib_retrieve(url, data=None):
    
    range_limit()
    print "uGET", url
    f = urlopen(url, data)
    html = f.read().decode('utf-8', 'ignore')
    return f.getcode(), html
725712
def get_context_data(self, **kwargs):
        
        kwargs.update({
            'view':             self,
            'email_form':       EmailLinkForm(),
            'external_form':    ExternalLinkForm(),
            'type_email':       Link.LINK_TYPE_EMAIL,
            'type_external':    Link.LINK_TYPE_EXTERNAL,
        })

        # If a form has been submitted, update context with
        # the submitted form value.
        if 'form' in kwargs:
            submitted_form = kwargs.pop('form')
            if isinstance(submitted_form, EmailLinkForm):
                kwargs.update({'email_form': submitted_form})
            elif isinstance(submitted_form, ExternalLinkForm):
                kwargs.update({'external_form': submitted_form})

        return kwargs
1299608
def formdata_post(url, fields):
    
    content_type, data = formdata_encode(fields)
    req = urllib2.Request(url, data)
    req.add_header('Content-Type', content_type)
    return urllib2.urlopen(req).read()
494540
async def parse_form(self, req: Request, name: str, field: Field) -> typing.Any:
        """"""
        post_data = self._cache.get("post")
        if post_data is None:
            self._cache["post"] = await req.post()
        return core.get_value(self._cache["post"], name, field)
1102620
function getURLParameter (name, url) {
    name = name.replace(/[[]/, '\\[').replace(/[\]]/, '\\]');
    var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
    var results = regex.exec(url);
    return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
}
72329
def urlencode_unicode(data, doseq=0):
    """"""
    data_iter = None
    if isdict(data):
        data_iter = list(data.items())
    elif islist(data):
        data_iter = data

    if data_iter:
        for i, (key, value) in enumerate(data_iter):
            if isinstance(value, text_type):
                # try to convert to str
                try:
                    safe_val = str(value)
                except UnicodeEncodeError:
                    # try to encode as utf-8
                    # if an exception is raised here then idk what to do
                    safe_val = value.encode('utf-8')
                finally:
                    if isdict(data):
                        data[key] = safe_val
                    else:
                        data[i] = (key, safe_val)

    return urlencode(data, doseq=doseq)
488075
def toURLEncoded(self):
        """"""
        args = self.toPostArgs().items()
        args.sort()
        return urllib.urlencode(args)
273458
public static String urlWithForm(String url, Map<String, Object> form, Charset charset, boolean isEncodeParams) {
		if (isEncodeParams && StrUtil.contains(url, '?')) {
			// 在需要编码的情况下，如果url中已经有部分参数，则编码之
			url = encodeParams(url, charset);
		}

		// url和参数是分别编码的
		return urlWithForm(url, toParams(form, charset), charset, false);
	}
906258
def get_http_info_with_retriever(self, request, retriever=None):
        
        if retriever is None:
            retriever = self.get_form_data

        urlparts = urlparse.urlsplit(request.url)

        try:
            data = retriever(request)
        except ClientDisconnected:
            data = {}

        return {
            'url': '%s://%s%s' % (urlparts.scheme, urlparts.netloc, urlparts.path),
            'query_string': urlparts.query,
            'method': request.method,
            'data': data,
            'headers': dict(get_headers(request.environ)),
            'env': dict(get_environ(request.environ)),
        }
697983
function pForm (url, form){
    var options = {
        method: 'POST',
        uri: url,
        form: form,
        headers: {
            'content-type': 'application/x-www-form-urlencoded'
        }
    };
    return rp(options);
}
177611
function getRequestUri() {
    if (isset($_SERVER['REQUEST_URI'])) {
      $uri = $_SERVER['REQUEST_URI'];
    }
    else {
      if (isset($_SERVER['argv'])) {
        $uri = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['argv'][0];
      }
      elseif (isset($_SERVER['QUERY_STRING'])) {
        $uri = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'];
      }
      else {
        $uri = $_SERVER['SCRIPT_NAME'];
      }
    }
    // Prevent multiple slashes to avoid cross site requests via the Form API.
    $uri = '/' . ltrim($uri, '/');

    return $uri;
  }