cURL / Mailing Lists / curl-users / Single Mail

curl-users

Problems with null values between cURL and multipart/form-data posting

From: Alain BIU <alain.biu1_at_mail.com>
Date: Thu, 27 May 2004 03:00:25 -0500

Hi,
I'm experiencing a POST problem with cURL using multipart/form-data (option -F)

While working fine for most scenarios, there seems to be an existing problem when trying to post null values as part of the http request body

My scenario is as follows:

1) HTTP POST to simulate:
========================================================
-----------------------------7d4348225058a
Content-Disposition: form-data; name="__EVENTTARGET"

_ctl:lbn_Login
-----------------------------7d4348225058a
Content-Disposition: form-data; name="__EVENTARGUMENT"

-----------------------------7d4348225058a
Content-Disposition: form-data; name="__VIEWSTATE"

blablabla
-----------------------------7d4348225058a
Content-Disposition: form-data; name="_ctl:txt_UserEmail"

blabla_at_bla.com
-----------------------------7d4348225058a
Content-Disposition: form-data; name="_ctl:txt_UserPassword"

Blabala
-----------------------------7d4348225058a--

2) Command line used (only including -F option)
========================================================

> curl -F "__EVENTTARGET=_ctl:lbn_Login" -F "__EVENTARGUMENT=" -F "__VIEWSTATE=blablabla" -F "_ctl:txt_UserEmail=blabla_at_bla.com" -F "_ctl:txt_UserPassword=Blabala" $URL

3) Sniffing trace on the server side shows that the HTTP post dies after the "__EVENTARGUMENT" parameter has been passed (associated to the command -F "__EVENTARGUMENT=") with the server terminating with an error

Is there an "official" way to pass null values for an argument part of a multipart/form-data HTTP post?
Tried the following without any further success:
- -F "__EVENTARGUMENT="
- -F "__EVENTARGUMENT=''"

ANy ideas?
Thanks

Alain Biu

-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm
Received on 2004-05-27