Skip to content

axios support select multiple has bug #7365

@startjava

Description

@startjava

default 3 select

                <select name="select3" size="5" multiple="multiple">
                    <option value="301" selected>301</option>
                    <option value="302" selected>302</option>
                    <option value="303" selected>303</option>
                </select>

js code

                const {data} = await axios.post('http://localhost:8080/post/querySelectorForm_to_json__RequestBody', document.querySelector('#form1'), {
                    headers: {
                        'Content-Type': 'application/json'
                    }
                });

F12 run result array in array

Image

i want result is :
["301", "302", "303"]

default axios code has bug ??
I don't want to use transformRequest. I just want to use the default code provided by the Axios official documentation:
https://axios-http.com/zh/docs/post_example

const {data} = await axios.post('/user', document.querySelector('#my-form'), {
  headers: {
    'Content-Type': 'application/json'
  }
})

However, from the results, it seems that it is not very user-friendly for the "select multiple" option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue::bugThis issue is related to a bug that requires fixing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions