-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
Allows plain body to be set, rather than just JSON or Form variables #9
Conversation
Hey thanks for the PR. Sling separates building a request (with various boilerplate setters, culminating in a call to You can already set a plain body on the http.Request directly.
A test to that effect:
You're right though, there is a reasonable case for a However, its signature should be |
0732dce
to
715ff8d
Compare
Thanks for the helpful reply/comment. I've changed the commit and pushed the new version with the correct signature. Is that what you require? Have I done it the right way? |
Actually the docs say that |
@@ -33,6 +33,8 @@ type Sling struct { | |||
bodyJSON interface{} | |||
// url tagged body struct (form) | |||
bodyForm interface{} | |||
// simply assigned body | |||
body string |
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.
// plain body
body io.ReadCloser
715ff8d
to
7a309c3
Compare
Thanks for the Dalton, I appreciate you taking the time to help me make this better. Let's see if this version is OK? I think |
Ah, I see the problem. If we make a separate
and use I tweaked that little bit and merged as 3b289d0 Thanks! Hope you're enjoying Go! |
Hi Dalton,
I wanted to use https://github.com/Jeffail/gabs with Sling, but found that you don't allow setting the body manually, only from an existing JSON-marshallable structure or form data. Here's a PR that allows you to manually set the body.
I'm pretty new to Go, so if I've done anything daft feel free to let me know and I'll amend it.
Cheers,
Andy