Help, don't know what's wrong with my HTTP multipart POST

后端 未结 2 388
迷失自我
迷失自我 2021-01-24 06:19
POST /upload HTTP/1.1
Host: assets.drop.io
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2
009042316 Firefox/3.0.10
Accept: text/html,ap         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-24 07:07

    The schematic syntax of a multipart/form-data message is as follows:

    Content-Type: multipart/form-data; boundary=boundary
    
    --boundary
    Content-Disposition: form-data; name="field 1"
    
    data 1
    --boundary
    Content-Disposition: form-data; name="field 2"
    
    data 2
    ⋮
    --boundary
    Content-Disposition: form-data; name="field N"
    
    data N
    --boundary--
    

    So the inner part boundaries are --boundary (-- followed by the boundary value) and the last is --boundary-- (-- followed by the boundary value followed by --).

    In your case you are just missing the leading --.

提交回复
热议问题