-
Notifications
You must be signed in to change notification settings - Fork 1.7k
allow body for HTTPBodyContains and HTTPBodyNotContains for POST #938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow body for HTTPBodyContains and HTTPBodyNotContains for POST #938
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your effort, this looks great! :)
I have left a small comment about testing the new logic added. Beyond that, I'd be happy to merge this once it's resolved.
if values != nil { | ||
url = url + "?" + values.Encode() | ||
} | ||
req, err := http.NewRequest(method, url, body) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this logic has been added, would it not make sense to add new test cases to check for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will add some tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Thank you!
Would it be possible to give example for the simple GET request in GoDoc/pkg.go.dev documentation? The example given
no longer works, and more frustratingly none of the test scripts I've written work without rolling back the package version to 1.5.1. |
@dpajkovic , apologies. I just realised that I should have tagged this for v2 rather than 1.6.0 😞 . I will revert this change and release a 1.6.1 quickly. |
POST" PR stretchr#938 This reverts commit 136026f.
oh, sorry @dpajkovic missed that part, so what happens to this changes now @boyan-soubachov ? |
@gohargasparyan, I guess the following options are available to us: IMO probably the best approaches would be (in order of preference): c -> a -> b :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can't be merged in v1.
And v2 is very far away.
@@ -6,6 +6,7 @@ | |||
package assert | |||
|
|||
import ( | |||
io "io" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the alias
@@ -6,6 +6,7 @@ | |||
package assert | |||
|
|||
import ( | |||
io "io" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the alias
Summary
Issue #925
Http Assertions does not allow the creation of a body
Changes
Related issues
#925