如何传递单个网址参数的多个值? [英] How to pass multiple values for a single URL parameter?

查看:129
本文介绍了如何传递单个网址参数的多个值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以在不使用自己的分隔符的情况下传递单个URL参数的多个值?

Is it possible to pass multiple values for a single URL parameter without using your own separator?

我想做的是后端期望输入参数 urls 具有一个或多个值。我可以将其设置为单个或多个URL。什么是设置urls参数的方法,以便它可以有多个值?我不能使用我自己的分隔符,因为它可以是值本身的一部分。

What I want to do is that the backend expects an input parameter urls to have one or more values. It can me set to a single or multiple URLs. What is a way to set the urls parameter so it can have multiple values? I can't use my own separator because it can be part of the value itself.

示例:
http://example.com/?urls= [value,value2 ...]

Example: http://example.com/?urls=[value,value2...]

urls 参数设置为 http://google.com 或者可以设置至 http://google.com http://yahoo.com ... 。在后端,我想将每个url作为一个单独的值进行处理。

The urls parameter be set to just http://google.com or it can be set to http://google.com http://yahoo.com .... In the backend, I want to process each url as a separate values.

推荐答案

http://.../?urls=foo&urls=bar&...

...

request.GET.getlist('urls')

这篇关于如何传递单个网址参数的多个值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆