How to pass multiple values for a single URL parameter?

前端 未结 2 2086
遇见更好的自我
遇见更好的自我 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')

    0 讨论(0)
  • 2021-01-03 23:59
    http://.../?urls=foo&urls=bar&...
    

    ...

    request.GET.getlist('urls')
    
    0 讨论(0)
提交回复
热议问题