Code Monkey home page Code Monkey logo

Comments (5)

gruns avatar gruns commented on June 8, 2024

To be explicit, your expected behavior is to unpack the list as repeated query
parameters, right? Like

>>> from furl import furl
>>> f = furl('http://www.google.com/?one=1').add({'two':[1,2,3,4]})
>>> f.url
'http://www.google.com/?one=1&two=1&two=2&two=3&two=4'

correct?

from furl.

jzp113 avatar jzp113 commented on June 8, 2024

yes, f = furl('http://www.google.com/?one=1').add({'two':{1:1}}) too

from furl.

gruns avatar gruns commented on June 8, 2024

Which version of furl do you run? It's likely an old version.

The latest furl, v0.4.92, already supports both lists and dictionaries as
parameter values via add() and set(), exactly as you desire.

>>> import furl
>>> furl.__version__
'0.4.91'
>>> furl.furl('http://www.google.com/?one=1').add({'two':[1,2,3,4]}).url
'http://www.google.com/?one=1&two=1&two=2&two=3&two=4'
>>> furl.furl('http://www.google.com/?one=1').add({'two':{1:1}}).url
'http://www.google.com/?one=1&two=1'

You can update to the latest furl with

pip install furl --upgrade

Does the latest furl, v0.4.92, work for you?

from furl.

jzp113 avatar jzp113 commented on June 8, 2024

thanks,it's work

from furl.

gruns avatar gruns commented on June 8, 2024

Great.

Thank you for bringing this issue to my attention, @jzp113.

from furl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.