python - How to use requests module to submit data with multiple same names in one post?
迷茫
迷茫 2017-06-12 09:19:36
0
3
711

As shown in the picture, there are three fields in the data submitted to be posted, all namedtags[], but the contents are different. What should I do to post all three fields?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all (3)
伊谢尔伦

First lineview source

    迷茫

    You can merge the three fields on the client side into a JSON string into one field, and then decode it when getting it on the server side and it’s OK

      巴扎黑

      If you can use the python requests module, you can refer to the answer here How to submit multiple files with the same POST name with requests?

      parameters = [('tags', 'test'), ('tags', 'submit'), ('tags', 'tool')]

      Then use the method you are accustomed to, such as

      r = requests.get("http://httpbin.org/get", params=parameters )
        Latest Downloads
        More>
        Web Effects
        Website Source Code
        Website Materials
        Front End Template
        About us Disclaimer Sitemap
        php.cn:Public welfare online PHP training,Help PHP learners grow quickly!