Looking into ZnClient
class in the System Browser you can see the comments for following methods:
formAt:add:
- "Add key equals value to the application/x-www-form-urlencoded entity of the current request. This is for multi-values form fields."
formAt:put:
- "Set key equal to value in the application/x-www-form-urlencoded entity of the current request."
formAdd:
- "Add the key->value association to the application/x-www-form-urlencoded entity of the current request."
formAddAll:
- "Add all key->value associations of keyedCollection to
the application/x-www-form-urlencoded entity of the current request."
We haven't used formAt:add:
in any of our previous q&a on this and we should avoid it here. Use one of the last 3 methods:
| client |
client := ZnClient new url: 'http://server/some-script.cgi'.
then...
client formAt: 'technique' put: 'foo';
formAt: 'resultat' put: 'bar';
formAt: 'conclusion' put: 'baz';
post.
or...
client formAdd: 'technique' -> 'foo';
formAdd: 'resultat' -> 'bar';
formAdd: 'conclusion' -> 'baz';
post.
or this...
client formAddAll: {
'technique' -> 'foo'.
'resultat' -> 'bar'.
'conclusion' -> 'baz'.
} asDictionary; post.