Http POST in Java (with file upload)

前端 未结 5 1134
野的像风
野的像风 2020-12-14 03:33

What I want to do is submit a web form from a java application. The form I need to fill out is located here: http://cando-dna-origami.org/

When the form is submitte

5条回答
  •  余生分开走
    2020-12-14 03:48

    I am currently writing a small web server, and I tested your request client. My server is receiving the following request:

    User-Agent: Java/1.6.0_20 
    Host: localhost:1700 
    Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 
    Connection: keep-alive 
    Content-type: application/x-www-form-urlencoded 
    Content-Length: 287 
    name=M+V&affiliation=Company&email=m.v%40gmail.com&axialRise=0.34&helixDiameter=2.25&axialStiffness=1100&bendingStiffness=230&torsionalStiffness=460&nickStiffness=0.01&resolution=course&jsonUpload=C%3A%2FUsers%2FMarjie%2FDownloads%2Ftwisted_DNA_bundles%2Fmonotwist.L1.v1.json&type=square
    

    You should check the format of the POST data you are sending, most probably it is not processed by the server as you would expect.

提交回复
热议问题