iterate over all form fields to build a request querystring to get params from it,
 for file_field we made a work around to pass a digest as value to later replace it
 in params hash with the real file.
480256
def params
      query_string = []
      replaces = {}

      fields.each do |field|
        next if field.to_query_string.nil?
        replaces.merge!({field.digest_value => field.test_uploaded_file}) if field.is_a?(FileField)
        query_string << field.to_query_string
      end

      query_params = self.class.query_string_to_params(query_string.join('&'))

      query_params = self.class.replace_params_values(query_params, replaces)

      self.class.unescape_params(query_params)
    end
560529
def parse_querystring(self, req, name, field):
        """"""
        return get_value(req.query_arguments, name, field)
246035
def parse_querystring(self, req: Request, name: str, field: Field) -> typing.Any:
        """"""
        return core.get_value(req.query, name, field)
964411
def parse_form(self, req, name, field):
        
        form = self._cache.get("form")
        if form is None:
            self._cache["form"] = form = parse_form_body(req)
        return core.get_value(form, name, field)
629669
def get(self, request, *args, **kwargs):
        

        # Prepare base
        if 'pk' in kwargs:
            self.object = self.get_object()
        else:
            self.object = None
        form_class = self.get_form_class()

        # Get prefix
        if 'field_prefix' in form_class.Meta.__dict__:
            # Get name from the form
            field_prefix = form_class.Meta.field_prefix
        else:
            # Get name from the class
            field_prefix = str(form_class).split("'")[1].split(".")[-1]
        self.field_prefix = field_prefix

        # Build form
        form = self.get_form(form_class)

        # Find groups
        if 'groups' in dir(self):
            # Save groups
            groups = self.groups
            # Redefine groups inside the form
            form.__groups__ = lambda: groups
            # Initialize list of fields
            fields = []
        else:
            groups = None

        # Add special prefix support to properly support form independency
        form.add_prefix = lambda fields_name, field_prefix=field_prefix: "%s_%s" % (field_prefix, fields_name)
        if 'autofill' not in dir(form.Meta):
            form.Meta.autofill = {}

        # For every extra form
        forms = []
        position_form_default = 0
        for (formelement, linkerfield, modelfilter) in self.forms:
            if formelement is None:
                formobj = form
                position_form_default = len(forms)
            else:
                # Locate linked element
                if self.object:
                    related_name = formelement._meta.model._meta.get_field(linkerfield).related_query_name()
                    queryset = getattr(self.object, related_name)
                    if modelfilter:
                        queryset = queryset.filter(eval("Q(%s)" % (modelfilter)))
                    get_method = getattr(queryset, 'get', None)
                    if get_method:
                        instance = queryset.get()
                    else:
                        instance = queryset
                else:
                    instance = None

                if 'autofill' in dir(formelement.Meta):
                    formname = str(formelement).split('.')[-1].split("'")[0]
                    for key in formelement.Meta.autofill:
                        form.Meta.autofill['{}_{}'.format(formname, key)] = formelement.Meta.autofill[key]

                # Get prefix
                if 'field_prefix' in formelement.Meta.__dict__:
                    # Get name from the form
                    field_prefix = formelement.Meta.field_prefix
                else:
                    # Get name from the class
                    field_prefix = str(formelement).split("'")[1].split(".")[-1]
                self.field_prefix = field_prefix

                # Prepare form
                formobj = formelement(instance=instance)
                formobj.form_name = form.form_name

                # Excluded fields
                if 'exclude' not in formobj.Meta.__dict__:
                    formobj.Meta.exclude = [linkerfield]
                elif linkerfield not in formobj.Meta.exclude:
                    formobj.Meta.exclude.append(linkerfield)
                if linkerfield in formobj.fields:
                    del(formobj.fields[linkerfield])

                # Add special prefix support to properly support form independency
                formobj.add_prefix = lambda fields_name, field_prefix=field_prefix: "%s_%s" % (field_prefix, fields_name)
                formobj.scope_prefix = field_prefix

            # Save fields to the list
            if groups:
                for field in formobj:
                    fields.append(field)
            else:
                # Add the form to the list of forms
                forms.append(formobj)

        if position_form_default == 0:
            open_tabs = 1
        else:
            open_tabs = 0
        # Remember list of fields
        if groups:
            form.list_fields = fields

        # Add context and return new context
        return self.render_to_response(self.get_context_data(form=form, forms=forms, open_tabs=open_tabs, position_form_default=position_form_default))
77327
def parse_querystring(self, req, name, field):
        """"""
        return core.get_value(req.params, name, field)
1261806
def _get_request_param(self, request):
        """"""
        params = {}
        try:
            params = request.POST.copy()
            if not params:
                params = json.loads(request.body)
        except Exception:
            pass
        for key in params:
            # replace a value to a masked characters
            if key in self.mask_fields:
                params[key] = '*' * 8

        # when a file uploaded (E.g create image)
        files = request.FILES.values()
        if list(files):
            filenames = ', '.join(
                [up_file.name for up_file in files])
            params['file_name'] = filenames

        try:
            return json.dumps(params, ensure_ascii=False)
        except Exception:
            return 'Unserializable Object'
932166
def parse_form(self, req, name, field):
        """"""
        return get_value(req.body_arguments, name, field)
728756
def _validate_field(param, fields):
    

    if '/' not in param.field and param.field not in fields:
        raise InvalidQueryParams(**{
            'detail': 'The filter query param of "%s" is not possible. The '
                      'resource requested does not have a "%s" field. Please '
                      'modify your request & retry.' % (param, param.field),
            'links': LINK,
            'parameter': PARAM,
        })
1366908
def extract_params(env)
      result = env.fetch(QUERY_HASH, {})
      result.merge!(env.fetch(FORM_HASH, {}))
      result.merge!(Utils::Hash.deep_stringify(env.fetch(ROUTER_PARAMS, {})))
      result
    end
869438
def build_request_body(header_params, form_params, body)
      # http form
      if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
          header_params['Content-Type'] == 'multipart/form-data'
        data = {}
        form_params.each do |key, value|
          case value
          when ::File, ::Array, nil
            # let typhoeus handle File, Array and nil parameters
            data[key] = value
          else
            data[key] = value.to_s
          end
        end
      elsif body
        data = body.is_a?(String) ? body : body.to_json
      else
        data = nil
      end
      data
    end
315342
def encode_multipart_formdata(fields):
    
    BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$'
    CRLF = '\r\n'.encode('utf-8')
    L = []
    for (key, value) in fields:
        if not isinstance(value, types.InputFile):
            _append_bytes(L, '--' + BOUNDARY)
            _append_bytes(L, 'Content-Disposition: form-data; name="%s"' % key)
            _append_bytes(L, '')
            _append_bytes(L, value)
        else:
            _append_bytes(L, '--' + BOUNDARY)
            _append_bytes(L, 'Content-Disposition: form-data; name="%s"; filename="%s"' % (key, value.name))
            _append_bytes(L, 'Content-Type: %s' % value.content_type)
            _append_bytes(L, '')
            _append_bytes(L, value.content)
    _append_bytes(L, '--' + BOUNDARY + '--')
    _append_bytes(L, '')
    body = CRLF.join(L)
    content_type = 'multipart/form-data; boundary=%s' % BOUNDARY
    return content_type, body
205000
def __get_value(self, field_name):
        
        value = request.values.get(field_name)
        if value is None:
            if self.json_form_data is None:
                value = None
            elif field_name in self.json_form_data:
                value = self.json_form_data[field_name]
        return value
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
216859
def parse_query(str)
      query = Hash.new
      if str
        str.split(/[&;]/).each{|x|
          next if x.empty?
          key, val = x.split(/=/,2)
          key = unescape_form(key)
          val = unescape_form(val.to_s)
          val = FormData.new(val)
          val.name = key
          if query.has_key?(key)
            query[key].append_data(val)
            next
          end
          query[key] = val
        }
      end
      query
    end
314319
def format_file_url_params(file_urls):
        '''
            
        '''
        file_urls_payload = {}
        if file_urls:
            for idx, fileurl in enumerate(file_urls):
                file_urls_payload["file_url[" + str(idx) + "]"] = fileurl
        return file_urls_payload
76284
def build_upload_params(file_path, outputformat, callback_url = nil, options = {})
      upload_params = { :format => outputformat}
      upload_params.merge!(:callback => callback(callback_url)) if callback(callback_url).present?
      upload_params.merge!(:input => "download",:link => file_path )
      upload_params.merge!(options)
    end