Added GET_OR_HEAD method.#2555
Conversation
|
|
||
| RequestMethod that = (RequestMethod) o; | ||
|
|
||
| if (name.equals("GET_OR_HEAD") && (that.name.equals("GET") || that.name.equals("HEAD"))) { |
There was a problem hiding this comment.
I'm not sure doing the equals behaviour this way is a good idea. If we ever needed to put this e.g. as a map key I suspect this would prevent that from working properly.
There was a problem hiding this comment.
@tomakehurst Thanks for the feedback. Requested changes have been made.
|
|
||
| assertThat(response.statusCode(), is(200)); | ||
| assertThat(response.firstHeader("Content-Type"), is("application/json")); | ||
| assertThat(response.content(), is(emptyOrNullString())); |
There was a problem hiding this comment.
Would be great to see an assertion about Content-Length matching the length of the response body.
|
I was wondering if it would be worth just getting |
I did wonder about this, but the |
|
Thanks! |
* Added GET_OR_HEAD method * Added validations for Content-Length
Closes #2414 . This PR adds a GET_OR_HEAD method. This stub method could be used for both get as well as head Http method. The response and http header information is returned accordingly
Submitter checklist
#help-contributingor a project-specific channel like#wiremock-java