fetch - Missing boundary in multipart/form-data POST

前端 未结 6 1560
不知归路
不知归路 2020-11-27 14:45

thanks for stopping by.

I want to send a new FormData() as the body of a POST request using the fetch api

the operatio

6条回答
  •  自闭症患者
    2020-11-27 15:15

    Add headers:{content-type: undefined} browser will generate a boundary for you that is for uploading a file part-and-part with streaming if you are adding 'multiple/form-data' it means you should create streaming and upload your file part-and-part

    So it is okay to add request.headers = {content-type: undefined}

提交回复
热议问题