Add support for URL-encoded form parameters?
mangstadt opened this issue · comments
Michael Angstadt commented
This is referring to the parameters that are typically found in the body of POST requests when you submit a <form>
on a website.
HttpClientMock client = new HttpClientMock();
//request body looks like: username=John&password=secret%21
//content type is: application/x-www-form-urlencoded
client.verify().post("/login")
.withBodyParameter("username", "John")
.withBodyParameter("password", "secret!")
.called();
//or maybe
client.verify().post("/login")
.withBody(
new BasicNameValuePair("username", "John"),
new BasicNameValuePair("password", "secret!")
)
.called();
I have started looking at the codebase and working on a solution. Do you think this would be useful? Can HttpClientMock already do this?
Paweł Adamski commented
Merged in #20