Skip to content

Expose post() directly from agent #4

Closed
jheintz opened this Issue Sep 23, 2012 · 4 comments

2 participants

@jheintz
Gist Labs member
jheintz commented Sep 23, 2012

Expose a method to directly post from mechanize agent.

For example:

Page result = agent.post(urlString, mapParams);

Requested from mat in comments http://gistlabs.com/software/mechanize-for-java/

@jheintz
Gist Labs member
jheintz commented Sep 23, 2012

No reason not to also expose put() and delete()... :)

@MartinKersten
Gist Labs member

How about this:

Page Result = agent.post(urlString /URL /URI, Params.add(name, value).add(name, value).add(name,value));

There must be versions for adding and setting. Also the set must allow to set multiple values. Maybe even better:

Params.add(name, String ... value) adds the values to the params (check for duplicate);
Params.set(name, String... value) sets the values by removing old params.

@MartinKersten
Gist Labs member

I am on it.

@MartinKersten
Gist Labs member

Its in the post method branch. Please verify the solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.