How to pass multiple values for a single URL parameter?

前端 未结 2 2100
遇见更好的自我
遇见更好的自我 2021-01-03 23:07

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

What I want to do is that the backend expects an input parameter

2条回答
  •  醉话见心
    2021-01-03 23:49

    The following is probably the best way of doing it - ie, don't specify a delimited list of URLs, rather, use the fact you can specify the same param name multiple times, eg:

    http://example.com/?url=http://google.co.uk&url=http://yahoo.com
    

    The URL list be then be used and retrieved via request.GET.getlist('url')

提交回复
热议问题