-
-
Notifications
You must be signed in to change notification settings - Fork 740
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
[feat] sse client support method and body configure #988
[feat] sse client support method and body configure #988
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.
@vegetablechicken233 Thanks for creating a new PR. Just one minor comment on godoc. Once fixed, I will get it merged.
sse.go
Outdated
@@ -139,6 +150,14 @@ func (es *EventSource) SetHeader(header, value string) *EventSource { | |||
return es | |||
} | |||
|
|||
// SetBody method sets body value to the [EventSource] instance | |||
// | |||
// es.SetBody([]byte(`{"test":"put_data"}`),) |
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.
@vegetablechicken233 This good example requires a correction based on method input type. Also, it has a syntax issue: ,
is present near the closing curve bracket.
es.SetBody(strings.NewReader(`{"test":"put_data"}`))
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.
@jeevatkm already fix it
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## v3 #988 +/- ##
=======================================
Coverage 99.81% 99.82%
=======================================
Files 18 18
Lines 3885 3896 +11
=======================================
+ Hits 3878 3889 +11
Misses 5 5
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Thanks for the updates.
Make HTTP Method configurable and add corresponding test functions.
It should be noted that to ensure backward compatibility, the "method" field does not perform empty validation, but is set to "GET" by default (to align with the old version).
In addition, type of "body" field is temporarily set to "io.Reader" (it seems a bit too early to add support for "any"~
Separated from PR #985