cURL / Mailing Lists / curl-users / Single Mail

curl-users

-F for building forms

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 24 Sep 2001 07:58:46 +0200 (MET DST)

Hi

A friendly soul named Antti Valtokari added a suggestion in the curl feedback
forum, that we should add support for the letter '=' in form field names:

  http://curl.haxx.se/feedback/display.cgi?id=10002820566576&support=yes

Now I'm asking you for a different approach than the one suggested by Antti.
His way of introducing \ as an escape letter in the form field string doesn't
really seem fitting. It modifies the present treatment of \ (as it would
require that a single \ is written \\ in the future) and the same letter is
already used as a common shell escape letter, which might make it confusing
to users that at times you would be forced to use very many backslashes.

The best way might be to separate the name and the contents with two
different options (--form-name and --form-value perhaps). This would of
course break compatibility with how -F works today, but would prevent us from
having to introduce an escaping mechanism.

A different option would be to treat the entire string, or perhaps only the
part to the left of the '=' letter, as an URL encoded string that is decoded
before passed on. Thus Antti's example could've been written
fieldname:TYPE%3d123412=value (with %3d instead of '=').

So, we have a bunch of different alternatives:

 1) Antti's \-suggestion
 2) introduce two separate options for the single -F of today
 3a) URL decode the both sides of the = letter in the -F string
 3b) URL decode only the left side of the = letter in the -F string
 4) A totally different approach
 5) Do nothing, = letters in form field names are illegal

Which one would you prefer?

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-09-24