Author | Topic: POST to URL. | |
---|---|---|
Vladimir Iahnenco | POST to URL. on Fri, 11 Jun 2004 12:10:12 -0400 Hi Guys, Need some help, we need to POST a request to html page to submit a form on it. There are many hidden html inputs on the page along with File upload one. We can upload a file from that page to the server from IE. The question is what should be the request string format to post it, I tried a couple but always got responses like "AppVersion is invalid" (AppVersion is a hidden html var) or "Response Type is invalid" The source of html page: <FORM NAME="CertMenuTestPldUploadForm1" METHOD="Post" ACTION="https://www.somesite.com/somepage" ENCTYPE=multipart/form-data> <INPUT VALUE="username" TYPE="HIDDEN" NAME="UserId"> <INPUT VALUE="password=" TYPE="HIDDEN" NAME="Password"> <INPUT VALUE="P" TYPE="HIDDEN" NAME="UploadType"> <INPUT VALUE="V4R1" TYPE="HIDDEN" NAME="VersionNumber"> <INPUT VALUE="TEXT/HTML" TYPE="HIDDEN" NAME="ResponseType"> <INPUT VALUE="2.0" TYPE="HIDDEN" NAME="AppVersion"> <INPUT VALUE="YES" TYPE="HIDDEN" NAME="AcceptUPSLicenseAgreement"> <INPUT VALUE="YYYYYYY" TYPE="HIDDEN" NAME="PUFFFlags"> <INPUT VALUE="username" TYPE="HIDDEN" NAME="CertUserIDHiddenInput"> <INPUT VALUE="password=" TYPE="HIDDEN" NAME="CertPasswdHiddenInput"> <INPUT VALUE="0200" TYPE="HIDDEN" NAME="CertVersionHiddenInput"> <INPUT VALUE="N" TYPE="HIDDEN" NAME="CertUploadHiddenInput"> <INPUT TYPE="FILE" NAME="Filename" SIZE="25"> </FORM> My request string: POST /somepage HTTP/1.1 Host: www.somesite.com Content-type: multipart/mixed; boundary=BOUNDARY Content-length: 29308 --BOUNDARY Content-type: application/x-www-form-urlencoded Content-length: 279 UserId=username&Password=password&UploadType=M&VersionNumber=V4R1&ResponseTy pe=application/x-ups-pld&AppVersion=2.0&AcceptUPSLicenseAgreement=YES&PUFFFl ags=YYYYYYY&CertUserIDHiddenInput=username&CertPasswdHiddenInput=password&Ce rtVersionHiddenInput=0200&CertUploadHiddenInput=N --BOUNDARY Content-type: application/x-ups-binary Content-length: 28854 ..binary data goes here --BOUNDARY. Thanks in advance Best regards, Vladimir --- mailto: vladimir.iahnenco@scancode.com |